tengo este response que me genero una integracion en HL7 FHIR y necesito almacenar el id…
- User
tengo este response que me genero una integracion en HL7 FHIR y necesito almacenar el id del serviceRequest y el identifier value del serviceRequest , que forma me recomiendas para buscarlo en php ?
{ "resourceType": "Bundle", "id": "6a6498e6-4a73-4b9a-9bee-7ccf9b815354", "meta": { "versionId": "1", "lastUpdated": "2024-10-14T09:15:47.655-03:00", "tag": [ { "system": "message", "code": "response" } ] }, "type": "message", "entry": [ { "resource": { "resourceType": "MessageHeader", "id": "2d80777a-f094-416f-948e-1a7d2af4e5e9", "meta": { "lastUpdated": "2024-10-14T09:13:00-03:00", "profile": [ "https://interoperabilidad.minsal.cl/fhir/ig/tei/StructureDefinition/MessageHeaderLE" ] }, "eventCoding": { "system": "https://interoperabilidad.minsal.cl/fhir/ig/tei/CodeSystem/CSTipoEventoLE", "code": "iniciar" }, "author": { "reference": "PractitionerRole/501ae9c3-02b9-4380-90b9-d26cf9f7e82d" }, "source": { "software": "AVIS", "endpoint": "IPAVIS-HJNC-10-10-2024" }, "focus": [ { "reference": "ServiceRequest/b45dadc7-7d73-4fe6-87ef-d85be8b94a00" } ] }, "request": { "method": "PUT", "url": "MessageHeader/2d80777a-f094-416f-948e-1a7d2af4e5e9" } }, { "resource": { "resourceType": "MessageHeader", "id": "2d80777a-f094-416f-948e-1a7d2af4e5e9", "meta": { "versionId": "1", "lastUpdated": "2024-10-14T09:15:47-03:00", "profile": [ "https://interoperabilidad.minsal.cl/fhir/ig/tei/StructureDefinition/MessageHeaderLE" ] }, "eventCoding": { "system": "https://interoperabilidad.minsal.cl/fhir/ig/tei/CodeSystem/CSTipoEventoLE", "code": "iniciar" }, "author": { "reference": "PractitionerRole/501ae9c3-02b9-4380-90b9-d26cf9f7e82d" }, "source": { "software": "AVIS", "endpoint": "IPAVIS-HJNC-10-10-2024" }, "focus": [ { "reference": "ServiceRequest/b45dadc7-7d73-4fe6-87ef-d85be8b94a00" } ] }, "response": { "id": "2d80777a-f094-416f-948e-1a7d2af4e5e9", "status": "201 Created", "location": "MessageHeader/2d80777a-f094-416f-948e-1a7d2af4e5e9/_history/1", "lastModified": "2024-10-14T09:15:47.000-03:00" } }, { "resource": { "resourceType": "Encounter", "id": "fc3cd035-44c0-4254-a0b7-cca2e5c51f85", "meta": { "versionId": "1", "lastUpdated": "2024-10-14T09:15:47.279-03:00", "profile": [ "https://interoperabilidad.minsal.cl/fhir/ig/tei/StructureDefinition/EncounterIniciarLE" ] }, "identifier": [ { "value": "1835822" } ], "status": "finished", "class": { "system": "", "code": "1", "display": "Presencial" }, "subject": { "reference": "" }, "participant": [ { "individual": { "reference": "PractitionerRole/501ae9c3-02b9-4380-90b9-d26cf9f7e82d" } } ], "period": { "start": "2024-10-10T12:00:00+10:00", "end": "2024-10-10T12:00:00+10:00" }, "diagnosis": [ { "condition": { "reference": "Condition/4f745b55-e8bc-4218-be3e-bd0e4c5f5717" } } ] }, "response": { "id": "fc3cd035-44c0-4254-a0b7-cca2e5c51f85", "status": "201 Created", "location": "Encounter/fc3cd035-44c0-4254-a0b7-cca2e5c51f85/_history/1", "lastModified": "2024-10-14T09:15:47.279-03:00" } }, { "resource": { "resourceType": "Patient", "id": "AC1728574337650", "meta": { "versionId": "2", "lastUpdated": "2024-10-14T09:15:47.459-03:00", "profile": [ "" ] }, "extension": [ { "url": "", "valueCodeableConcept": { "coding": [ { "system": "", "code": "1", "display": "Masculino" } ] } }, { "url": "", "valueCodeableConcept": { "coding": [ { "system": "", "code": "152", "display": "Chile" } ] } }, { "url": "", "valueCodeableConcept": { "coding": [ { "system": "", "code": "152", "display": "Chile" } ] } }, { "url": "", "valueBoolean": true } ], "identifier": [ { "use": "official", "type": { "extension": [ { "url": "", "valueCodeableConcept": { "coding": [ { "system": "", "code": "152", "display": "Chile" } ] } } ], "coding": [ { "system": "", "code": "01", "display": "RUN" } ] }, "value": "17556242-7" } ], "active": true, "name": [ { "use": "official", "family": "Gaete", "_family": { "extension": [ { "url": "", "valueString": "Sierra" } ] }, "given": [ "Elias Ricardo" ] } ], "telecom": [ { "system": "phone", "value": "123456789" } ], "gender": "male", "birthDate": "1992-08-10", "deceasedBoolean": false, "address": [ { "use": "home", "text": "18 de septiembre , 1000", "line": [ "18 de septiembre 1000" ] } ] }, "response": { "id": "AC1728574337650", "status": "200 OK", "location": "Patient/AC1728574337650/_history/2", "lastModified": "2024-10-14T09:15:47.459-03:00" } }, { "resource": { "resourceType": "PractitionerRole", "id": "501ae9c3-02b9-4380-90b9-d26cf9f7e82d", "meta": { "versionId": "1", "lastUpdated": "2024-10-14T09:15:47.507-03:00", "profile": [ "" ] }, "practitioner": { "reference": "Practitioner/614f2788-8067-4bf7-ac8c-a250c48cf9f1" }, "organization": { "reference": "Organization/2f6d29ae-c32e-4827-acc6-d3515b8c721a" }, "code": [ { "coding": [ { "system": "", "code": "iniciador", "display": "Iniciador" } ] } ] }, "response": { "id": "501ae9c3-02b9-4380-90b9-d26cf9f7e82d", "status": "201 Created", "location": "PractitionerRole/501ae9c3-02b9-4380-90b9-d26cf9f7e82d/_history/1", "lastModified": "2024-10-14T09:15:47.507-03:00" } }, { "resource": { "resourceType": "Practitioner", "id": "614f2788-8067-4bf7-ac8c-a250c48cf9f1", "meta": { "versionId": "1", "lastUpdated": "2024-10-14T09:15:47.542-03:00", "profile": [ "" ] }, "identifier": [ { "use": "official", "type": { "coding": [ { "system": "", "code": "01", "display": "RUN" } ] }, "value": "16225552-5" } ], "name": [ { "family": "Altamirano", "_family": { "extension": [ { "url": "", "valueString": "Altamirano" } ] }, "given": [ "Rodrigo" ] } ], "gender": "male", "birthDate": "1985-10-06", "qualification": [ { "identifier": [ { "value": "cert" } ], "code": { "coding": [ { "system": "", "code": "1", "display": "MÃDICO CIRUJANO" } ], "text": "MÃDICO CIRUJANO" } } ] }, "response": { "id": "614f2788-8067-4bf7-ac8c-a250c48cf9f1", "status": "201 Created", "location": "Practitioner/614f2788-8067-4bf7-ac8c-a250c48cf9f1/_history/1", "lastModified": "2024-10-14T09:15:47.542-03:00" } }, { "resource": { "resourceType": "Organization", "id": "2f6d29ae-c32e-4827-acc6-d3515b8c721a", "meta": { "versionId": "1", "lastUpdated": "2024-10-14T09:15:47.570-03:00", "profile": [ "" ] }, "identifier": [ { "system": "", "value": "101300" } ], "name": "CENTRO DE SALUD FAMILIAR VÃCTOR BERTÃN SOTO" }, "response": { "id": "2f6d29ae-c32e-4827-acc6-d3515b8c721a", "status": "201 Created", "location": "Organization/2f6d29ae-c32e-4827-acc6-d3515b8c721a/_history/1", "lastModified": "2024-10-14T09:15:47.570-03:00" } }, { "resource": { "resourceType": "Condition", "id": "4f745b55-e8bc-4218-be3e-bd0e4c5f5717", "meta": { "versionId": "1", "lastUpdated": "2024-10-14T09:15:47.593-03:00", "profile": [ "" ] }, "clinicalStatus": { "coding": [ { "system": "", "code": "active", "display": "Active" } ] }, "verificationStatus": { "coding": [ { "system": "", "code": "confirmed", "display": "Confirmed" } ] }, "category": [ { "coding": [ { "system": "", "code": "encounter-diagnosis", "display": "Encounter Diagnosis" } ] } ], "code": { "coding": [ { "system": "", "code": "G501", "display": "DOLOR FACIAL ATIPICO" } ] }, "subject": { "reference": "" }, "encounter": { "reference": "Encounter/fc3cd035-44c0-4254-a0b7-cca2e5c51f85" } }, "response": { "id": "4f745b55-e8bc-4218-be3e-bd0e4c5f5717", "status": "201 Created", "location": "Condition/4f745b55-e8bc-4218-be3e-bd0e4c5f5717/_history/1", "lastModified": "2024-10-14T09:15:47.593-03:00" } }, { "resource": { "resourceType": "ServiceRequest", "id": "b45dadc7-7d73-4fe6-87ef-d85be8b94a00", "meta": { "versionId": "1", "lastUpdated": "2024-10-14T09:15:47.630-03:00", "profile": [ "" ] }, "extension": [ { "url": "", "valueCodeableConcept": { "coding": [ { "system": "", "code": "1", "display": "APS" } ] } }, { "url": "", "valueCodeableConcept": { "coding": [ { "system": "", "code": "1", "display": "A la espera de referencia" } ] } }, { "url": "", "valueCodeableConcept": { "coding": [ { "system": "", "code": "30", "display": "MEDICINA INTERNA" } ] } } ], "identifier": [ { "value": "d22dd2de-0276-4e4f-96aa-0da832d101ed" } ], "status": "draft", "intent": "order", "category": [ { "coding": [ { "system": "", "code": "1", "display": "Presencial" } ] } ], "priority": "routine", "code": { "coding": [ { "system": "", "code": "103696004" } ] }, "subject": { "reference": "" }, "encounter": { "reference": "Encounter/fc3cd035-44c0-4254-a0b7-cca2e5c51f85" }, "authoredOn": "2024-07-11T12:31:00Z", "requester": { "reference": "PractitionerRole/PractitionerRoleIniciadorHJNC3" }, "reasonCode": [ { "coding": [ { "system": "", "code": "1", "display": "Confirmación" } ] } ] }, "response": { "id": "b45dadc7-7d73-4fe6-87ef-d85be8b94a00", "status": "201 Created", "location": "ServiceRequest/b45dadc7-7d73-4fe6-87ef-d85be8b94a00/_history/1", "lastModified": "2024-10-14T09:15:47.630-03:00" } } ] }
- Assistant
Para buscar y almacenar el del y su en PHP desde la estructura JSON proporcionada, puedes utilizar las funciones de decodificación JSON y un bucle para recorrer las entradas del JSON. Aquí te muestro un ejemplo de cómo podrías hacerlo: