|
4 min de lecture
|

Comment créer un IG

Résumer cet article avec :
ChatGPTPerplexityClaudeGrok

Comment développer un IG FHIR

Un IG FHIR (Implementation Guide) est un ensemble d'artefacts décrivant les exigences d'un serveur FHIR. Par exemple, un IG peut contenir un ensemble de règles, de profils, d'extensions, de paramètres de recherche et d'exemples de ressources FHIR.

L'IG est décrit sous forme de paquet NPM ayant la structure suivante :

  • package (sous-dossier) package.json (manifeste du paquet)
  • Un ensemble de fichiers de ressources canoniques…

Manifeste du paquet

Pour commencer à créer un IG, nous devons décrire le fichier manifeste du paquet. Un manifeste de paquet est un fichier JSON appelé 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"
	}
}

Contenu du paquet

Un paquet contient un ensemble de ressources FHIR au format JSON. Décrivons quelques ressources pour le paquet.

2.1 Profil

Décrivons un profil du US Core Patient dans le fichier 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
            }
        ]
    }
}

Nous avons décrit un profil qui hérite du US Core Patient et ajoute un champ obligatoire pour l'adresse.

2.2 Ressource SearchParameter

Décrivons un paramètre de recherche personnalisé sur la ressource Patient dans le fichier 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"
}

Compilation du paquet NPM

Le paquet npm résultant présente la structure suivante :

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

Nous devons compiler les artefacts du paquet npm en une archive au format TAR (.tar.gz).

tar -czvf package.tar.gz package

En suivant le guide, téléversez l'archive dans Aidbox.

Communiquez avec nous pour nous présenter vos cas d'utilisation et vos exigences, ou commencez à utiliser les abonnements thématiques d'Aidbox gratuitement grâce à nos licences de développement.

Voir aussi : 4 façons de téléverser des IG dans Aidbox.

Partager cet article
Comments
Comments
Sign in
Loading comments...
Subscribe to our blog

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