1

I am working with fhirclient-4.0.0 and using this library to send Http requests to my fhir server. For the update request, I need to send one extra header 'If-Match'. But I don't see any option to do this or to set custom header.

This is my python code.

    from fhirclient import client
    import fhirclient.models.encounter as en
    settings = {
        'app_id': 'fhir',
        'api_base': 'http://hapi.fhir.org/baseR4'
    }
    smart = client.FHIRClient(settings=settings) 

    encounter = en.Encounter()
    encounter.id = get_fhir_encounter_id(<parameter>)
    encounter.subject = get_fhir_encounter_subject(<parameter>)
    encounter.location = get_fhir_encounter_location(<parameter>)
    encounter.period = get_fhir_encounter_period(<parameter>)
    encounter.reasonCode = get_fhir_encounter_reasoncode(<parameter>)
    encounter.status = get_fhir_encouter_status(<parameter>)
    encounter.identifier = get_fhir_encounter_identifier(<parameter>)
    encounter.class_fhir = get_fhir_encounter_class(<parameter>)

    #Sending the update request
    en.Encounter.update(encounter, smart.server)

Is there any configuration that I can use to set a custom header?

Neeraj
  • 11
  • 1

1 Answers1

0

I believe this PR fixes part of your issue https://github.com/smart-on-fhir/client-py/pull/66 might need another PR to pull the headers all the way through to the resource models