From ec705e993b63f91ba1dcd6e52eab8d260b5fdd76 Mon Sep 17 00:00:00 2001 From: Lorenz Kapsner Date: Tue, 10 May 2022 17:27:15 +0200 Subject: [PATCH] chore: updated todos for https://github.com/miracum/fhir-gateway/issues/42, https://github.com/miracum/fhir-gateway/issues/31 --- .../fhirgateway/stores/PostgresFhirResourceRepository.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/org/miracum/etl/fhirgateway/stores/PostgresFhirResourceRepository.java b/src/main/java/org/miracum/etl/fhirgateway/stores/PostgresFhirResourceRepository.java index 15d9320c..1a8bae94 100644 --- a/src/main/java/org/miracum/etl/fhirgateway/stores/PostgresFhirResourceRepository.java +++ b/src/main/java/org/miracum/etl/fhirgateway/stores/PostgresFhirResourceRepository.java @@ -83,6 +83,13 @@ private int insertResources(Bundle bundle) { .map( resource -> new Object[] { + // TODO add encounter id / patient id / encounter_start date here + // this would depend also on the resources, e.g. + // type = "Patient": Encounter-ID: NULL, Patient-ID: Patient.id + // type = "Encounter": Encounter-ID: Encounter.id, Patient.id: REPLACE(jsonb_path_query(Encounter.DATA, '$.subject') ->> 'reference', 'Patient/', '') + // type = "Condition": Encounter-ID: REPLACE(Condition.DATA -> 'encounter' ->> 'reference', 'Encounter/', '') + // type = "Procedure": Encounter-ID: REPLACE(Procedure.DATA -> 'encounter' ->> 'reference', 'Encounter/', '') + // type = "Observation": Encounter-ID: REPLACE(Observation.DATA -> 'encounter' ->> 'reference', 'Encounter/', '') resource.getIdElement().getIdPart(), resource.fhirType(), fhirParser.encodeResourceToString(resource)