---
{
  "title": "How to build IG",
  "description": "FHIR IG (Implementation Guide) ist eine Sammlung von Artefakten, die die Anforderungen an einen FHIR-Server beschreiben. Ein IG kann beispielsweise einen Satz von Regeln, Profile, Erweiterungen, Suchparameter und Beispiele für FHIR-Ressourcen enthalten.",
  "date": "2025-04-10",
  "author": "Ivan Bagrov",
  "reading-time": "4 min",
  "tags": [
    "FHIR Profiling",
    "FHIR Standard"
  ]
}
---
## Wie man einen FHIR IG entwickelt

FHIR IG ([Implementation Guide](/blog/how-to-create-a-fhir-implementation-guide)) ist eine Sammlung von Artefakten, die die Anforderungen an einen [FHIR-Server](https://www.health-samurai.io/fhir-server) beschreiben. Ein IG kann beispielsweise einen Satz von Regeln, Profile, Erweiterungen, Suchparameter und Beispiele für FHIR-Ressourcen enthalten.

Der IG wird als NPM-Paket mit folgender Struktur beschrieben:
- package (Unterordner)
package.json (Paket-Manifest)
- Eine Menge kanonischer Ressourcendateien …

**Paket-Manifest**

Um mit der Erstellung eines IG zu beginnen, müssen wir die Paket-Manifest-Datei beschreiben. Ein Paket-Manifest ist eine JSON-Datei namens package.json.


```javascript
{
	// 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"
	}
}
```


## Paketinhalt

Ein Paket enthält eine Menge von FHIR-Ressourcen im JSON-Format. Beschreiben wir einige Ressourcen für das Paket.

### 2.1 Profil

Beschreiben wir ein Profil des US Core Patient in der Datei *StructureDefinition-my-patient-profile.json.*


```javascript
{
    // 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
            }
        ]
    }
}
```


Wir haben ein Profil beschrieben, das vom US Core Patient erbt und ein Pflichtfeld für die Adresse hinzufügt.

### 2.2 SearchParameter-Ressource

Beschreiben wir einen benutzerdefinierten Suchparameter für die Patient-Ressource in der Datei *SearchParamete-my-patient-search.json.*


```javascript
{
	// 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"
}
```


**NPM-Paket erstellen**

Das resultierende NPM-Paket hat folgende Struktur:


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


Wir müssen die Artefakte des NPM-Pakets in ein Archiv im TAR-Format (.tar.gz) kompilieren.


```javascript
tar -czvf package.tar.gz package
```


Laden Sie das Archiv gemäß [der Anleitung](https://www.health-samurai.io/docs/aidbox/readme-1/validation-tutorials/upload-fhir-implementation-guide/aidbox-ui/local-ig-package) in Aidbox hoch.

> [Kontaktieren Sie uns](https://www.health-samurai.io/contacts) mit Ihren Anwendungsfällen und Anforderungen, oder starten Sie kostenlos mit themenbasierten Aidbox-Abonnements dank [unserer Entwicklungslizenzen](https://aidbox.app/ui/portal#/signin).

Siehe auch: [4 Möglichkeiten, IGs in Aidbox hochzuladen](/blog/4-ways-to-upload-igs-to-aidbox-pros-and-cons).