miércoles, julio 29, 2020

HAPI FHIR for Dummies (20200601)

Cuando estamos arrancando con HAPI FHIR una cosa que me ayudo mucho es que existe un servidor público de test. Para acceder al servidor público tengo que acceder a la siguiente url: http://hapi.fhir.org/


Este servidor de test fue muy útil al comienzo de mi investigación sobre HAPI FHIR.

HAPI FHIR for Dummies (20200701)

Si te encuentras en la etapa de aprender sobre HAPI FHIR aquí va un Tip de los mas básicos.
Cuando te encuentras frente a un servidor HAPI FHIR lo primero que debes hacer para saber que es lo que se encuentra disponible en ese servidor es acceder a su "metadata". Para hacer una prueba puedo acceder al servidor de test de hapi: http://hapi.fhir.org/baseR4/metadata




Ejemplo de la respuesta:


HTTP 200 OK
Response Headers
X-Powered-By: HAPI FHIR 5.1.0-SNAPSHOT REST Server (FHIR Server; FHIR 4.0.1/R4)
Content-Type: application/fhir+xml;charset=utf-8
X-Request-ID: NhDkIGO8AFlOSg6K
Response Body
{
"resourceType": "CapabilityStatement",
"status": "active",
"date": "2020-07-29T15:43:40+00:00",
"publisher": "Not provided",
"kind": "instance",
"software": {
"name": "HAPI FHIR Server",
"version": "5.1.0-SNAPSHOT"
},
"implementation": {
"description": "UHN Test Server (R4 Resources)",
"url": "http://hapi.fhir.org/baseR4"
},
"fhirVersion": "4.0.1",
"format": [ "application/fhir+xml", "application/fhir+json" ],
"rest": [ {
"extension": [ {
"url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-websocket",
"valueUri": "/websocketR4"
} ],
"mode": "server",
"resource": [ {
"extension": [ {
"url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount",
"valueDecimal": 500
} ],
"type": "Account",
"profile": "http://hl7.org/fhir/StructureDefinition/Account",
"interaction": [ {
"code": "read"
}, {
"code": "vread"
}, {
"code": "update"
}, {
"code": "patch"
}, {
"code": "delete"
}, {
"code": "history-instance"
}, {
"code": "history-type"
}, {
"code": "create"
}, {
"code": "search-type"
} ],
"versioning": "versioned-update",
"conditionalCreate": true,
"conditionalUpdate": true,
"conditionalDelete": "multiple",
"searchInclude": [ "*", "Account:owner", "Account:patient", "Account:subject" ],
"searchParam": [ {
"name": "_language",
"type": "string",
"documentation": "The language of the resource"
}, {
"name": "owner",
"type": "reference",
"documentation": "Entity managing the Account"
}, {
"name": "identifier",
"type": "token",
"documentation": "Account number"
}, {
"name": "period",
"type": "date",
"documentation": "Transaction window"
}, {
"name": "patient",
"type": "reference",
"documentation": "The entity that caused the expenses"
}, {
"name": "subject",
"type": "reference",
"documentation": "The entity that caused the expenses"
}, {
"name": "SearchByMsgDate",
"type": "date",
"documentation": "Search by patient for a MSH.7 agreement, which is stored in Patient Resource"
}, {
"name": "name",
"type": "string",
"documentation": "Human-readable label"
}, {
"name": "_id",
"type": "token",
"documentation": "The ID of the resource"
}, {
"name": "type",
"type": "token",
"documentation": "E.g. patient, expense, depreciation"
}, {
"name": "status",
"type": "token",
"documentation": "active | inactive | entered-in-error | on-hold | unknown"
} ]
}, {
"extension": [ {
"url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount",
"valueDecimal": 83
} ],
"type": "ActivityDefinition",
"profile": "http://hl7.org/fhir/StructureDefinition/ActivityDefinition",
"interaction": [ {
"code": "read"
}, {
"code": "vread"
}, {
"code": "update"
}, {
"code": "patch"
}, {
"code": "delete"
}, {
"code": "history-instance"
}, {
"code": "history-type"
}, {
"code": "create"
}, {
"code": "search-type"
} ],
"versioning": "versioned-update",
"conditionalCreate": true,
"conditionalUpdate": true,
"conditionalDelete": "multiple",
"searchInclude": [ "*", "ActivityDefinition:composed-of", "ActivityDefinition:depends-on",
"ActivityDefinition:derived-from", "ActivityDefinition:predecessor", "ActivityDefinition:successor" ],
"searchParam": [ {
"name": ....


La lista es muy extensa ya que es el servidor público de hapi pero seguramente el servidor que me encuentro desarrollando tenga una lista menor, por ejemplo mi servidor local tiene la siguiente lista:


http://localhost:7070/hapilocal/fhir/metadata


Al acceder a la "metadata" de mi implementación se muestra lo que tengo disponible hasta el momento.




HTTP 200 OK
Response Headers
X-Powered-By: HAPI FHIR 5.0.2 REST Server (FHIR Server; FHIR 1.0.2/DSTU2)
X-Request-ID: lbcIeZTv5EZMae6L
Response Body
{
"resourceType": "Conformance",
"publisher": "Not provided",
"date": "2020-07-29T12:04:08-03:00",
"kind": "instance",
"software": {
"name": "HAPI FHIR Server",
"version": "5.0.2"
},
"implementation": {
"description": "HAPI FHIR",
"url": "http://localhost:7070/hapilocal/fhir"
},
"fhirVersion": "1.0.2",
"acceptUnknown": "extensions",
"format": [ "application/xml+fhir", "application/json+fhir" ],
"rest": [ {
"mode": "server",
"resource": [ {
"type": "Location",
"profile": {
"reference": "http://hl7.org/fhir/profiles/Location"
},
"interaction": [ {
"code": "read"
}, {
"code": "vread"
}, {
"code": "update"
}, {
"code": "create"
}, {
"code": "search-type"
} ]
}, {
"type": "OperationDefinition",
"profile": {
"reference": "http://hl7.org/fhir/profiles/OperationDefinition"
},
"interaction": [ {
"code": "read"
} ]
}, {
"type": "Organization",
"profile": {
"reference": "http://hl7.org/fhir/profiles/Organization"
},
"interaction": [ {
"code": "read"
} ]
}, {
"type": "Patient",
"profile": {
"reference": "http://hl7.org/fhir/profiles/Patient"
},
"interaction": [ {
"code": "read"
}, {
"code": "vread"
}, {
"code": "update"
}, {
"code": "create"
}, {
"code": "search-type"
} ],
"searchParam": [ {
"name": "family",
"type": "string",
"documentation": "A portion of the family name of the patient"
} ]
}, {
"type": "Practitioner",
"profile": {
"reference": "http://hl7.org/fhir/profiles/Practitioner"
},
"interaction": [ {
"code": "read"
}, {
"code": "vread"
}, {
"code": "update"
}, {
"code": "create"
}, {
"code": "search-type"
} ],
"searchParam": [ {
"name": "family",
"type": "string",
"documentation": "A portion of the family name"
} ]
}, {
"type": "StructureDefinition",
"profile": {
"reference": "http://hl7.org/fhir/profiles/StructureDefinition"
},
"interaction": [ {
"code": "read"
}, {
"code": "search-type"
} ]
} ]
} ]
}
Wrote 2,4 KB (32,6 KB total including HTML) in estimated 16ms