Atención de Urgencia Interoperable
0.1.2-qa-preview - qa-preview
Atención de Urgencia Interoperable, published by Unidad de Interoperabilidad - MINSAL. This guide is not an authorized publication; it is the continuous build for version 0.1.2-qa-preview built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/Minsal-CL/IG_Urgencia/ and changes regularly. See the Directory of published versions
El mecanismo de intercambio definido para las transacciones es RESTful API. En este marco RESTful, las transacciones se realizan directamente sobre el recurso del servidor utilizando una solicitud/respuesta HTTP.
[base] (Ej: https://fhir.example.com/fhir)Bundle del tipo transaction (type=transaction)request el tipo de transacción a realizar (POST/PUT){
"resourceType" : "Bundle",
"id" : "Ej1BundleAdmision",
"meta" : {
"profile" : [
"https://interoperabilidad.minsal.cl/fhir/ig/urgencia/StructureDefinition/BundleAdmision"
]
},
"type" : "transaction",
"entry" : [
{
"fullUrl" : "urn:uuid:6ec6dc25-4b65-4165-a545-9b796f60b997",
"resource" : {
"resourceType" : "Patient",
"id" : "6ec6dc25-4b65-4165-a545-9b796f60b997",
"meta" : {
"profile" : [
"https://interoperabilidad.minsal.cl/fhir/ig/urgencia/StructureDefinition/PatientUrg"
]
},
... // Otra información del recurso Patient
},
"request" : {
"method" : "POST",
"url" : "Patient",
"ifNoneExist" : "identifier=90000000-6"
}
},
{
"fullUrl" : "urn:uuid:d1391b7b-302a-49f8-a908-8116599e137e",
"resource" : {
"resourceType" : "Encounter",
"id" : "d1391b7b-302a-49f8-a908-8116599e137e",
"meta" : {
"profile" : [
"https://interoperabilidad.minsal.cl/fhir/ig/urgencia/StructureDefinition/EncounterUrg"
]
},
... // Otra información del recurso Encounter
},
"request" : {
"method" : "POST",
"url" : "Encounter"
}
},
{
"fullUrl" : "urn:uuid:b9f6967f-51b5-49f4-8576-ce9f588523c2",
"resource" : {
"resourceType" : "Practitioner",
"id" : "b9f6967f-51b5-49f4-8576-ce9f588523c2",
"meta" : {
"profile" : [
"https://interoperabilidad.minsal.cl/fhir/ig/urgencia/StructureDefinition/PrestadorAdministrativo"
]
},
... // Otra información del recurso Practitioner
},
"request" : {
"method" : "POST",
"url" : "Practitioner",
"ifNoneExist" : "identifier=44444444-4"
}
},
... // Otros recursos
]
}
transaction-response (type=transaction-response){
"resourceType": "Bundle",
"type": "transaction-response",
"entry": [
{
"response": {
"status": "201 Created",
"location": "Patient/123",
"etag": "W/\"1\"",
"lastModified": "2024-12-09T12:00:00Z"
}
},
{
"response": {
"status": "201 Created",
"location": "Encounter/456",
"etag": "W/\"2\"",
"lastModified": "2024-12-09T12:00:00Z"
}
},
{
"response": {
"status": "200 OK",
"location": "Practitioner/789",
"etag": "W/\"2\"",
"lastModified": "2024-12-09T12:00:00Z"
}
}
... // Otros recursos
]
}
OperationOutcome{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "processing",
"diagnostics": "Invalid identifier in entry 2"
}
]
}
| Propiedad | Detalle |
|---|---|
| Método HTTP | POST |
| URL | https://fhir.example.com/fhir |
| Headers |
Content-Type: application/json+fhir
|
| Body |
{
"resourceType": "Bundle",
"type": "transaction",
... // Resto del mensaje
}
|
curl --location 'https://fhir.example.com/fhir' \
--header 'Content-Type: application/json+fhir' \
--data '{
"resourceType": "Bundle",
"type": "transaction"
}'
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://fhir.example.com/fhir");
var content = new StringContent("{\n \"resourceType\": \"Bundle\",\n \"type\": \"transaction\"\n}", null, "application/json+fhir");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
const axios = require('axios');
let data = JSON.stringify({
"resourceType": "Bundle",
"type": "transaction"
});
let config = {
method: 'post',
url: 'https://fhir.example.com/fhir',
headers: {
'Content-Type': 'application/json+fhir'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://fhir.example.com/fhir',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"resourceType": "Bundle",
"type": "transaction"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json+fhir'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
import json
url = "https://fhir.example.com/fhir"
payload = json.dumps({
"resourceType": "Bundle",
"type": "transaction"
})
headers = {
'Content-Type': 'application/json+fhir'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)