|
4 min de lectura
|

Cómo construir un IG

Resumir este artículo con:
ChatGPTPerplexityClaudeGrok

Cómo desarrollar un IG de FHIR

Un IG de FHIR (Implementation Guide) es un conjunto de artefactos que describen los requisitos para un servidor FHIR. Por ejemplo, un IG puede contener un conjunto de reglas, perfiles, extensiones, parámetros de búsqueda y ejemplos de recursos FHIR.

El IG se describe como un paquete NPM con la siguiente estructura:

  • package (subcarpeta) package.json (manifiesto del paquete)
  • Un conjunto de archivos de recursos canónicos…

Manifiesto del paquete

Para comenzar a crear un IG, es necesario describir el archivo de manifiesto del paquete. Un manifiesto de paquete es un archivo JSON denominado package.json.

{
	// The globally unique identifier of the package.
	// A package name consists of two or more namespaces separated by a dot.
	// Each namespace starts with a lowercase alphabet character
	"name": "myorganization.mypackage",

	// The version of the package (SemVer).
	// SHALL contain only letters, numbers, and the characters ".", "_", and "-"
	"version": "1.0.0",

	// The description of the package.
	"description": "My FHIR NPM Package",

	// The author of the package.
	"author": "Author Name",

	// The list of package dependencies.
	// Should contain at least one FHIR core package.
	"dependencies": {
    	  "hl7.fhir.r4.core": "4.0.1",
    	  "hl7.fhir.us.core": "5.0.1"
	}
}

Contenido del paquete

Un paquete contiene un conjunto de recursos FHIR en formato JSON. A continuación se describen algunos recursos para el paquete.

2.1 Perfil

Describamos un perfil del US Core Patient en el archivo StructureDefinition-my-patient-profile.json.

{
    // Type of the FHIR resource.
    "resourceType": "StructureDefinition",
    
    // How the type relates to the baseDefinition.
    "derivation": "constraint",
    
    // Defines the kind of structure that this definition is describing.
    "kind": "resource",
    
    // Type constrained by this structure.
    "type": "Patient",
    
    // The status of this structure definition.
    "status": "active",
    
    // Name for this structure definition (computer friendly).
    "name": "my-patient-profile",
    
    // 	Whether the structure is abstract.
    "abstract": false,
    
    //The Canonical identifier for this structure definition is represented as a URI (globally unique).
    "url": "http://custom-url/my-patient-profile",
    
    // Definition from which this type is constrained.
    "baseDefinition": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient",
    
    "differential": {
        "element": [
            {
                // Element ID
                "id": "Patient.address",
                
                // Path of the element in the hierarchy of elements
                "path": "Patient.address",
                
                // The minimum number of times this element SHALL appear in the instance.
                "min": 1
            }
        ]
    }
}

Hemos descrito un perfil que hereda del US Core Patient y añade un campo obligatorio para la dirección.

2.2 Recurso SearchParameter

Describamos un parámetro de búsqueda personalizado sobre el recurso Patient en el archivo SearchParamete-my-patient-search.json.

{
	// Type of the FHIR resource.
	"resourceType": "SearchParameter",
    
	// ID of the search parameter.
	"id": "Patient-myname",
    
	// Canonical identifier for this search parameter, represented as a URI (globally unique).
	"url": "http://hl7.org/fhir/SearchParameter/Patient-myname",
    
	// Business version of the search parameter.
	"version": "4.0.1",
    
	// Name for this search parameter (computer friendly).
	"name": "myname",
    
	// Natural language description of the search parameter.
	"description": "text",
    
	// The resource type(s) this search parameter applies to.
	"base": ["Patient"],
    
	// Status of the search parameter.
	"status": "active",
    
	// Recommended name for the parameter in search url.
	"code": "myname",
    
	// 	The type of value that a search parameter may contain, and how the content is interpreted.
	"type": "string",
    
	//FHIRPath expression that extracts the values.
	"expression": "Patient.name"
}

Construir el paquete NPM

El paquete npm resultante tiene la siguiente estructura:

package
├── StructureDefinition-my-patient-profile.json
├── SearchParameter-my-patient-search.json
└── package.json

Es necesario compilar los artefactos del paquete npm en un archivo en formato TAR (.tar.gz).

tar -czvf package.tar.gz package

Siguiendo la guía, cargue el archivo en Aidbox.

Póngase en contacto con nosotros con sus casos de uso y requisitos, o empiece a utilizar las suscripciones basadas en temas de Aidbox de forma gratuita con nuestras licencias de desarrollo.

Véase también: 4 formas de cargar IGs en Aidbox.

Compartir este artículo
Comments
Comments
Sign in
Loading comments...
Subscribe to our blog

Get the latest articles on FHIR, interoperability, and healthcare IT.