diff --git a/app/fhirquestionnaire/fhir.py b/app/fhirquestionnaire/fhir.py index 792579b..ff8a19e 100644 --- a/app/fhirquestionnaire/fhir.py +++ b/app/fhirquestionnaire/fhir.py @@ -85,10 +85,7 @@ def submit_consent(study, patient_email, form, pdf=None, dry=False): text = '
{}
'.format(render_to_string('consent/{}/_consent.html'.format(study))) # Generate composition - composition = PPMFHIR.Resources.composition(patient, timestamp, text, [consent, contract]) - - # Add the study reference - composition.setdefault("section", []).append({"entry": [{"reference": f"ResearchStudy/{PPM.Study.fhir_id(study)}"}]}) + composition = PPMFHIR.Resources.composition(patient, timestamp, text, PPM.Study.get(study), [consent, contract]) # Add it to the resources resources.append(composition) @@ -213,10 +210,7 @@ def submit_asd_individual(patient_email, forms, dry=False): text = '
{}
'.format(render_to_string('consent/asd/_individual_consent.html')) # Generate composition - composition = PPMFHIR.Resources.composition(patient, timestamp, text, [consent, contract]) - - # Add the study reference - composition.setdefault("section", []).append({"entry": [{"reference": f"ResearchStudy/{PPM.Study.fhir_id(PPM.Study.ASD)}"}]}) + composition = PPMFHIR.Resources.composition(patient, timestamp, text, PPM.Study.ASD, [consent, contract]) # Bundle it into a transaction bundle = PPMFHIR.Resources.bundle([questionnaire_response, consent, contract, composition, quiz_questionnaire_response]) @@ -341,10 +335,7 @@ def submit_asd_guardian(patient_email, forms, dry=False): text = '
{}
'.format(render_to_string('consent/asd/_guardian_consent.html')) # Generate composition - composition = PPMFHIR.Resources.composition(patient, timestamp, text, [consent, signature_contract, explained_contract]) - - # Add the study reference - composition.setdefault("section", []).append({"entry": [{"reference": f"ResearchStudy/{PPM.Study.fhir_id(PPM.Study.ASD)}"}]}) + composition = PPMFHIR.Resources.composition(patient, timestamp, text, PPM.Study.ASD, [consent, signature_contract, explained_contract]) # Map exception codes to linkId ward_exception_codes = { diff --git a/requirements.txt b/requirements.txt index 2ffa65b..38ff018 100644 --- a/requirements.txt +++ b/requirements.txt @@ -311,9 +311,9 @@ orderedmultidict==1.0.1 \ --hash=sha256:04070bbb5e87291cc9bfa51df413677faf2141c73c61d2a5f7b26bea3cd882ad \ --hash=sha256:43c839a17ee3cdd62234c47deca1a8508a3f2ca1d0678a3bf791c87cf84adbf3 # via furl -ppm-utils==2.0.4 \ - --hash=sha256:8c20e7edf44cd107425a5f7d5281e63408013eac1e69e6f2ce307895c0752b53 \ - --hash=sha256:92755026bd29224025a2c9ad04552a482420891aba86fe81ade3680463994b7f +ppm-utils==2.0.5 \ + --hash=sha256:eefe497da10c690dffc6a85b88a60d4d9efc0f0c48ec720fa549c8ca82c726a5 \ + --hash=sha256:f4d3a29c84c46047070144729b533d46294945f6762d23cfd5fc504c0d8ed1a7 # via -r requirements.in proto-plus==1.24.0 \ --hash=sha256:30b72a5ecafe4406b0d339db35b56c4059064e69227b8c3bda7462397f966445 \