@@ -33,7 +33,7 @@ public final class GeccoFhirClientStub implements GeccoFhirClient
3333 private static final Logger logger = LoggerFactory .getLogger (GeccoFhirClientStub .class );
3434
3535 private static final String condition = "{\" resourceType\" :\" Condition\" ,\" meta\" :{\" profile\" :[\" https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/chronic-lung-diseases\" ]},\" clinicalStatus\" :{\" coding\" :[{\" system\" :\" http://terminology.hl7.org/CodeSystem/condition-clinical\" ,\" code\" :\" active\" ,\" display\" :\" Active\" }]},\" verificationStatus\" :{\" coding\" :[{\" system\" :\" http://terminology.hl7.org/CodeSystem/condition-ver-status\" ,\" code\" :\" confirmed\" ,\" display\" :\" Confirmed\" },{\" system\" :\" http://snomed.info/sct\" ,\" code\" :\" 410605003\" ,\" display\" :\" Confirmed present (qualifier value)\" }]},\" category\" :[{\" coding\" :[{\" system\" :\" http://snomed.info/sct\" ,\" code\" :\" 418112009\" ,\" display\" :\" Pulmonary medicine\" }]}],\" code\" :{\" coding\" :[{\" system\" :\" http://snomed.info/sct\" ,\" code\" :\" 413839001\" ,\" display\" :\" Chronic lung disease\" }]},\" recordedDate\" :\" 2020-11-10T15:50:41.000+01:00\" }" ;
36- private static final String patient = "{\" resourceType\" :\" Patient\" ,\" meta\" :{\" profile\" :[\" https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/Patient\" ]},\" extension\" :[{\" url\" :\" https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/ethnic-group\" ,\" valueCoding\" :{\" system\" :\" http://snomed.info/sct\" ,\" code\" :\" 186019001 \" ,\" display\" :\" Other ethnic, mixed origin \" }},{\" url\" :\" https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/age\" ,\" extension\" :[{\" url\" :\" dateTimeOfDocumentation\" ,\" valueDateTime\" :\" 2020-10-01\" },{\" url\" :\" age\" ,\" valueAge\" :{\" value\" :67,\" unit\" :\" years\" ,\" system\" :\" http://unitsofmeasure.org\" ,\" code\" :\" a\" }}]}],\" birthDate\" :\" 1953-09-30\" }" ;
36+ private static final String patient = "{\" resourceType\" :\" Patient\" ,\" meta\" :{\" profile\" :[\" https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/Patient\" ]},\" extension\" :[{\" url\" :\" https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/ethnic-group\" ,\" valueCoding\" :{\" system\" :\" http://snomed.info/sct\" ,\" code\" :\" 26242008 \" ,\" display\" :\" Mixed (qualifier value) \" }},{\" url\" :\" https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/age\" ,\" extension\" :[{\" url\" :\" dateTimeOfDocumentation\" ,\" valueDateTime\" :\" 2020-10-01\" },{\" url\" :\" age\" ,\" valueAge\" :{\" value\" :67,\" unit\" :\" years\" ,\" system\" :\" http://unitsofmeasure.org\" ,\" code\" :\" a\" }}]}],\" birthDate\" :\" 1953-09-30\" }" ;
3737 private static final String observation = "{\" resourceType\" :\" Observation\" ,\" meta\" :{\" profile\" :[\" https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/sars-cov-2-rt-pcr\" ]},\" identifier\" :[{\" type\" :{\" coding\" :[{\" system\" :\" http://terminology.hl7.org/CodeSystem/v2-0203\" ,\" code\" :\" OBI\" }]}}],\" status\" :\" final\" ,\" category\" :[{\" coding\" :[{\" system\" :\" http://loinc.org\" ,\" code\" :\" 26436-6\" },{\" system\" :\" http://terminology.hl7.org/CodeSystem/observation-category\" ,\" code\" :\" laboratory\" }]}],\" code\" :{\" coding\" :[{\" system\" :\" http://loinc.org\" ,\" code\" :\" 94500-6\" ,\" display\" :\" SARS-CoV-2 (COVID-19) RNA [Presence] in Respiratory specimen by NAA with probe detection\" }],\" text\" :\" SARS-CoV-2-RNA (PCR)\" },\" effectiveDateTime\" :\" 2020-11-10T15:50:41.000+01:00\" ,\" valueCodeableConcept\" :{\" coding\" :[{\" system\" :\" http://snomed.info/sct\" ,\" code\" :\" 260373001\" ,\" display\" :\" Detected (qualifier value)\" }],\" text\" :\" SARS-CoV-2-RNA positiv\" }}" ;
3838
3939 private final GeccoClient geccoClient ;
@@ -82,15 +82,18 @@ public Stream<DomainResource> getNewData(String pseudonym, DateWithPrecision exp
8282 logger .warn ("Returning demo resources for {}" , pseudonym );
8383
8484 Patient p = geccoClient .getFhirContext ().newJsonParser ().parseResource (Patient .class , patient );
85+ p .setIdElement (new IdType (UUID .randomUUID ().toString ()));
8586 p .addIdentifier ().setSystem (NAMING_SYSTEM_NUM_CODEX_DIC_PSEUDONYM ).setValue (pseudonym ).getType ()
8687 .getCodingFirstRep ().setSystem (IDENTIFIER_NUM_CODEX_DIC_PSEUDONYM_TYPE_SYSTEM )
8788 .setCode (IDENTIFIER_NUM_CODEX_DIC_PSEUDONYM_TYPE_CODE );
8889 p .setIdElement (new IdType ("Patient" , UUID .randomUUID ().toString ()));
8990
9091 Condition c = geccoClient .getFhirContext ().newJsonParser ().parseResource (Condition .class , condition );
92+ c .setIdElement (new IdType (UUID .randomUUID ().toString ()));
9193 c .setSubject (new Reference (p .getIdElement ()));
9294
9395 Observation o = geccoClient .getFhirContext ().newJsonParser ().parseResource (Observation .class , observation );
96+ o .setIdElement (new IdType (UUID .randomUUID ().toString ()));
9497 o .setSubject (new Reference (p .getIdElement ()));
9598
9699 return Stream .of (p , c , o );
0 commit comments