Metadata data model

Updated:

FieldTypeRequiredDescription
resourceTypeenumYesAlways CapabilityStatement Values: Patient, Practitioner, Encounter, Observation, Condition, AllergyIntolerance, MedicationRequest, Immunization, Bundle, OperationOutcome, CapabilityStatement
statusenumYesactive Values: active
datestringYesDate last changed
kindenumYesinstance Values: instance
softwareobjectNoSoftware that is covered by this capability statement
software.namestringYesA name the software is known by
implementationobjectNoIf this describes a specific instance
implementation.descriptionstringYesDescribes this specific instance
implementation.urlstringNoBase URL for the installation
fhirVersionstringYesFHIR Version the system supports (4.0.1)
formatstring[]Noformats supported (json, application/fhir+json)
restFhirCapabilityStatementRest[]NoIf the endpoint is a RESTful one
rest[].modeenumYesserver Values: server
rest[].documentationstringNoGeneral description of implementation
rest[].securityFhirCapabilityStatementRest_securityNoInformation about security of implementation
rest[].security.descriptionstringNoGeneral description of how security works
rest[].resourceFhirCapabilityStatementResource[]NoResource served on the REST interface
rest[].resource[].typestringYesA resource type that is supported
rest[].resource[].interactionFhirCapabilityStatementInteraction[]NoWhat operations are supported?
rest[].resource[].interaction[].codeenumYesread | search-type Values: read, search-type
rest[].resource[].searchParamFhirCapabilityStatementSearchParam[]NoSearch parameters supported by implementation
rest[].resource[].searchParam[].namestringYesName of search parameter
rest[].resource[].searchParam[].typeenumYestoken | date | reference Values: token, date, reference
rest[].resource[].searchParam[].documentationstringNoServer-specific usage

TypeScript

TypeScript
export type FhirCapabilityStatement = {
	resourceType: 'Patient' | 'Practitioner' | 'Encounter' | 'Observation' | 'Condition' | 'AllergyIntolerance' | 'MedicationRequest' | 'Immunization' | 'Bundle' | 'OperationOutcome' | 'CapabilityStatement'; // Always CapabilityStatement
	status: 'active'; // active
	date: string; // Date last changed
	kind: 'instance'; // instance
	software?: {
		name: string; // A name the software is known by 
	}; // Software that is covered by this capability statement
	implementation?: {
		description: string; // Describes this specific instance 
		url?: string; // Base URL for the installation 
	}; // If this describes a specific instance
	fhirVersion: string; // FHIR Version the system supports (4.0.1)
	format?: string[]; // formats supported (json, application/fhir+json)
	rest?: []; // If the endpoint is a RESTful one
} 

Zod

Zod
import { z } from 'zod';

export const ZodFhirCapabilityStatement = z.object({
	resourceType: z.enum("Patient", "Practitioner", "Encounter", "Observation", "Condition", "AllergyIntolerance", "MedicationRequest", "Immunization", "Bundle", "OperationOutcome", "CapabilityStatement").describe("Always CapabilityStatement"),
	status: z.enum("active").describe("active"),
	date: z.string().describe("Date last changed"),
	kind: z.enum("instance").describe("instance"),
	software: z.object({
			name: z.string().describe("A name the software is known by")
}).optional().describe("Software that is covered by this capability statement"),
	implementation: z.object({
			description: z.string().describe("Describes this specific instance"),
			url: z.string().optional().describe("Base URL for the installation")
}).optional().describe("If this describes a specific instance"),
	fhirVersion: z.string().describe("FHIR Version the system supports (4.0.1)"),
	format: z.array().optional().describe("formats supported (json, application/fhir+json)"),
	rest: z.array().optional().describe("If the endpoint is a RESTful one")
});

Python

Python
import dataclasses

@dataclasses.dataclass
class FhirCapabilityStatementResourcetype(str, Enum):
	Patient = 'Patient'
	Practitioner = 'Practitioner'
	Encounter = 'Encounter'
	Observation = 'Observation'
	Condition = 'Condition'
	AllergyIntolerance = 'AllergyIntolerance'
	MedicationRequest = 'MedicationRequest'
	Immunization = 'Immunization'
	Bundle = 'Bundle'
	OperationOutcome = 'OperationOutcome'
	CapabilityStatement = 'CapabilityStatement'

@dataclasses.dataclass
class FhirCapabilityStatementStatus(str, Enum):
	active = 'active'

@dataclasses.dataclass
class FhirCapabilityStatementKind(str, Enum):
	instance = 'instance'

@dataclasses.dataclass
class PropertyFhirCapabilityStatementSoftware:
	"""A name the software is known by"""
	name: Optional[str]

@dataclasses.dataclass
class PropertyFhirCapabilityStatementImplementation:
	"""Describes this specific instance"""
	description: Optional[str]
	"""Base URL for the installation"""
	url: Optional[str]

@dataclasses.dataclass
class FhirCapabilityStatement:
	"""Always CapabilityStatement"""
	resourceType: FhirCapabilityStatementResourcetype
	"""active"""
	status: FhirCapabilityStatementStatus
	"""Date last changed"""
	date: str
	"""instance"""
	kind: FhirCapabilityStatementKind
	"""Software that is covered by this capability statement"""
	software: Optional[PropertyFhirCapabilityStatementSoftware]
	"""If this describes a specific instance"""
	implementation: Optional[PropertyFhirCapabilityStatementImplementation]
	"""FHIR Version the system supports (4.0.1)"""
	fhirVersion: str
	"""formats supported (json, application/fhir+json)"""
	format: Optional[List[List[str]]]
	"""If the endpoint is a RESTful one"""
	rest: Optional[PropertyFhirCapabilityStatementRest]
Are we missing anything? Let us know
Was this page helpful?