@@ -249,7 +249,7 @@ else if (resource instanceof Condition)
249249 Condition c = (Condition ) resource ;
250250 String profileUrl = getProfileUrl (resource , v -> v .startsWith (NUM_CODEX_STRUCTURE_DEFINITION_PREFIX ));
251251
252- String updateUrl = getInitialConditionalUpdateUrl (ResourceType .Condition .name (), profileUrl ,
252+ String updateUrl = getBaseConditionalUpdateUrl (ResourceType .Condition .name (), profileUrl ,
253253 patientIdentifier );
254254
255255 if (c .hasRecordedDateElement () && c .getRecordedDateElement ().getValueAsString () != null )
@@ -283,7 +283,7 @@ else if (resource instanceof Consent)
283283 .filter (Coding ::hasCode ).anyMatch (co -> "dnr" .equals (co .getCode ()));
284284
285285 if (scopePresent && categoryPresent )
286- return getInitialConditionalUpdateUrl (ResourceType .Consent .name (), profileUrl , patientIdentifier )
286+ return getBaseConditionalUpdateUrl (ResourceType .Consent .name (), profileUrl , patientIdentifier )
287287 + "&scope=http://terminology.hl7.org/CodeSystem/consentscope|adr"
288288 + "&category=http://terminology.hl7.org/CodeSystem/consentcategorycodes|dnr" ;
289289
@@ -299,7 +299,7 @@ else if (resource instanceof DiagnosticReport)
299299 DiagnosticReport dr = (DiagnosticReport ) resource ;
300300 String profileUrl = getProfileUrl (resource , v -> v .startsWith (NUM_CODEX_STRUCTURE_DEFINITION_PREFIX ));
301301
302- String updateUrl = getInitialConditionalUpdateUrl (ResourceType .DiagnosticReport .name (), profileUrl ,
302+ String updateUrl = getBaseConditionalUpdateUrl (ResourceType .DiagnosticReport .name (), profileUrl ,
303303 patientIdentifier );
304304
305305 if (dr .hasEffectiveDateTimeType () && dr .getEffectiveDateTimeType ().getValueAsString () != null )
@@ -318,13 +318,11 @@ else if (resource instanceof Immunization)
318318 Immunization i = (Immunization ) resource ;
319319 String profileUrl = getProfileUrl (resource , v -> v .startsWith (NUM_CODEX_STRUCTURE_DEFINITION_PREFIX ));
320320
321- String updateUrl = getInitialConditionalUpdateUrl (ResourceType .Immunization .name (), profileUrl ,
321+ String updateUrl = getBaseConditionalUpdateUrl (ResourceType .Immunization .name (), profileUrl ,
322322 patientIdentifier );
323323
324324 if (i .hasOccurrenceDateTimeType () && i .getOccurrenceDateTimeType ().getValueAsString () != null )
325325 updateUrl = updateUrl + "&date=" + i .getOccurrenceDateTimeType ().getValueAsString ();
326- else if (i .hasStatus ())
327- updateUrl = updateUrl + "&status=" + i .getStatus ().toCode ();
328326
329327 if (i .hasVaccineCode () && i .getVaccineCode ().hasCoding ())
330328 updateUrl = updateUrl + "&vaccine-code=" + i .getVaccineCode ().getCodingFirstRep ();
@@ -336,13 +334,11 @@ else if (resource instanceof MedicationStatement)
336334 MedicationStatement ms = (MedicationStatement ) resource ;
337335 String profileUrl = getProfileUrl (resource , v -> v .startsWith (NUM_CODEX_STRUCTURE_DEFINITION_PREFIX ));
338336
339- String updateUrl = getInitialConditionalUpdateUrl (ResourceType .MedicationStatement .name (), profileUrl ,
337+ String updateUrl = getBaseConditionalUpdateUrl (ResourceType .MedicationStatement .name (), profileUrl ,
340338 patientIdentifier );
341339
342340 if (ms .hasEffectiveDateTimeType () && ms .getEffectiveDateTimeType ().getValueAsString () != null )
343341 updateUrl = updateUrl + "&effective=" + ms .getEffectiveDateTimeType ();
344- else if (ms .hasStatus ())
345- updateUrl = updateUrl + "&status=" + ms .getStatus ().toCode ();
346342
347343 if (ms .hasMedicationCodeableConcept () && ms .getMedicationCodeableConcept ().hasCoding ())
348344 updateUrl = updateUrl + "&code="
@@ -356,7 +352,7 @@ else if (resource instanceof Observation)
356352 String profileUrl = getProfileUrl (resource , v -> v .startsWith (NUM_CODEX_STRUCTURE_DEFINITION_PREFIX )
357353 || MII_LAB_STRUCTURED_DEFINITION .equals (v ));
358354
359- String updateUrl = getInitialConditionalUpdateUrl (ResourceType .Observation .name (), profileUrl ,
355+ String updateUrl = getBaseConditionalUpdateUrl (ResourceType .Observation .name (), profileUrl ,
360356 patientIdentifier );
361357
362358 if (o .hasEffectiveDateTimeType () && o .getEffectiveDateTimeType ().getValueAsString () != null )
@@ -375,13 +371,11 @@ else if (resource instanceof Procedure)
375371 Procedure p = (Procedure ) resource ;
376372 String profileUrl = getProfileUrl (resource , v -> v .startsWith (NUM_CODEX_STRUCTURE_DEFINITION_PREFIX ));
377373
378- String updateUrl = getInitialConditionalUpdateUrl (ResourceType .Procedure .name (), profileUrl ,
374+ String updateUrl = getBaseConditionalUpdateUrl (ResourceType .Procedure .name (), profileUrl ,
379375 patientIdentifier );
380376
381377 if (p .hasPerformedDateTimeType () && p .getPerformedDateTimeType ().getValueAsString () != null )
382378 updateUrl = updateUrl + "&date=" + p .getPerformedDateTimeType ().getValueAsString ();
383- else if (p .hasStatus ())
384- updateUrl = updateUrl + "&status=" + p .getStatus ().toCode ();
385379
386380 if (p .hasCategory () && p .getCategory ().hasCoding ())
387381 updateUrl = updateUrl + "&category=" + getCodingUpdateUrl (p .getCategory ().getCodingFirstRep ());
@@ -403,7 +397,7 @@ private String getProfileUrl(DomainResource resource, Predicate<String> filter)
403397 + " not supported, missing NUM or MII profile" ));
404398 }
405399
406- private String getInitialConditionalUpdateUrl (String resourceName , String profileUrl , String patientIdentifier )
400+ private String getBaseConditionalUpdateUrl (String resourceName , String profileUrl , String patientIdentifier )
407401 {
408402 return resourceName + "?_profile=" + profileUrl + "&patient:identifier=" + patientIdentifier ;
409403 }
0 commit comments