mcp-generator 3.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mcp_generator-3.2.1/.babelfhir-ref/fhir-client.ts +350 -0
- mcp_generator-3.2.1/.babelfhir-ref/generator-index.ts +866 -0
- mcp_generator-3.2.1/.dockerignore +66 -0
- mcp_generator-3.2.1/.editorconfig +46 -0
- mcp_generator-3.2.1/.githooks/README.md +52 -0
- mcp_generator-3.2.1/.githooks/pre-commit +36 -0
- mcp_generator-3.2.1/.githooks/pre-commit.ps1 +35 -0
- mcp_generator-3.2.1/.github/FUNDING.yml +15 -0
- mcp_generator-3.2.1/.github/ISSUE_TEMPLATE/bug_report.md +78 -0
- mcp_generator-3.2.1/.github/ISSUE_TEMPLATE/feature_request.md +81 -0
- mcp_generator-3.2.1/.github/PULL_REQUEST_TEMPLATE.md +118 -0
- mcp_generator-3.2.1/.github/workflows/README.md +235 -0
- mcp_generator-3.2.1/.github/workflows/auto-pr-to-develop.yml +198 -0
- mcp_generator-3.2.1/.github/workflows/auto-pr-to-main.yml +212 -0
- mcp_generator-3.2.1/.github/workflows/auto-pr-to-staging.yml +175 -0
- mcp_generator-3.2.1/.github/workflows/create-release.yml +145 -0
- mcp_generator-3.2.1/.github/workflows/deploy-docs.yml +47 -0
- mcp_generator-3.2.1/.github/workflows/diff-summary.yml +139 -0
- mcp_generator-3.2.1/.github/workflows/inspector-tests.yml +129 -0
- mcp_generator-3.2.1/.github/workflows/publish.yml +33 -0
- mcp_generator-3.2.1/.github/workflows/test-examples.yml +116 -0
- mcp_generator-3.2.1/.github/workflows/tests.yml +86 -0
- mcp_generator-3.2.1/.github/workflows/update-changelog.yml +241 -0
- mcp_generator-3.2.1/.github/workflows/update-version-metadata.yml +109 -0
- mcp_generator-3.2.1/.gitignore +53 -0
- mcp_generator-3.2.1/CHANGELOG.md +493 -0
- mcp_generator-3.2.1/CODE_OF_CONDUCT.md +132 -0
- mcp_generator-3.2.1/CONTRIBUTING.md +507 -0
- mcp_generator-3.2.1/Dockerfile +85 -0
- mcp_generator-3.2.1/LICENSE +201 -0
- mcp_generator-3.2.1/PKG-INFO +847 -0
- mcp_generator-3.2.1/README.md +818 -0
- mcp_generator-3.2.1/SECURITY.md +130 -0
- mcp_generator-3.2.1/docs/changelog.md +10 -0
- mcp_generator-3.2.1/docs/comparison.md +71 -0
- mcp_generator-3.2.1/docs/contributing.md +90 -0
- mcp_generator-3.2.1/docs/getting-started/examples.md +65 -0
- mcp_generator-3.2.1/docs/getting-started/installation.md +56 -0
- mcp_generator-3.2.1/docs/getting-started/quickstart.md +134 -0
- mcp_generator-3.2.1/docs/guide/architecture.md +159 -0
- mcp_generator-3.2.1/docs/guide/authentication.md +175 -0
- mcp_generator-3.2.1/docs/guide/cli.md +129 -0
- mcp_generator-3.2.1/docs/guide/configuration.md +123 -0
- mcp_generator-3.2.1/docs/guide/middleware.md +145 -0
- mcp_generator-3.2.1/docs/guide/testing.md +103 -0
- mcp_generator-3.2.1/docs/index.md +107 -0
- mcp_generator-3.2.1/examples/README.md +122 -0
- mcp_generator-3.2.1/examples/minimal/openapi.json +86 -0
- mcp_generator-3.2.1/examples/petstore-openapi-3-0-4/openapi.json +1 -0
- mcp_generator-3.2.1/examples/petstore-openapi-3-1-0/openapi.json +133 -0
- mcp_generator-3.2.1/examples/petstore-swagger-2-0/openapi.json +1 -0
- mcp_generator-3.2.1/examples/proxy-smart/openapi.json +34400 -0
- mcp_generator-3.2.1/mcp_generator/__init__.py +60 -0
- mcp_generator-3.2.1/mcp_generator/__main__.py +11 -0
- mcp_generator-3.2.1/mcp_generator/a2a.py +238 -0
- mcp_generator-3.2.1/mcp_generator/cli.py +722 -0
- mcp_generator-3.2.1/mcp_generator/config.py +28 -0
- mcp_generator-3.2.1/mcp_generator/display_renderers.py +445 -0
- mcp_generator-3.2.1/mcp_generator/generate_client.py +702 -0
- mcp_generator-3.2.1/mcp_generator/generator.py +677 -0
- mcp_generator-3.2.1/mcp_generator/introspection.py +669 -0
- mcp_generator-3.2.1/mcp_generator/models.py +183 -0
- mcp_generator-3.2.1/mcp_generator/overlay.py +319 -0
- mcp_generator-3.2.1/mcp_generator/register_mcp.py +288 -0
- mcp_generator-3.2.1/mcp_generator/renderers.py +855 -0
- mcp_generator-3.2.1/mcp_generator/run_mcp.py +170 -0
- mcp_generator-3.2.1/mcp_generator/scripts/__init__.py +5 -0
- mcp_generator-3.2.1/mcp_generator/scripts/generate_jwt_keypair.py +117 -0
- mcp_generator-3.2.1/mcp_generator/scripts/generate_openapi_client.py +416 -0
- mcp_generator-3.2.1/mcp_generator/scripts/test_with_inspector.py +175 -0
- mcp_generator-3.2.1/mcp_generator/scripts/validate_openapi.py +434 -0
- mcp_generator-3.2.1/mcp_generator/templates/authentication.py +284 -0
- mcp_generator-3.2.1/mcp_generator/templates/cache_middleware.py +287 -0
- mcp_generator-3.2.1/mcp_generator/templates/display_tools.py +551 -0
- mcp_generator-3.2.1/mcp_generator/templates/dockerfile_template.py +251 -0
- mcp_generator-3.2.1/mcp_generator/templates/event_store.py +189 -0
- mcp_generator-3.2.1/mcp_generator/templates/fastmcp_template.json +99 -0
- mcp_generator-3.2.1/mcp_generator/templates/oauth_provider.py +599 -0
- mcp_generator-3.2.1/mcp_generator/templates/pyproject_template.toml +45 -0
- mcp_generator-3.2.1/mcp_generator/templates/storage_backend.py +286 -0
- mcp_generator-3.2.1/mcp_generator/templates/test/__init__.py +1 -0
- mcp_generator-3.2.1/mcp_generator/templates/test/test_auth_flows.py +598 -0
- mcp_generator-3.2.1/mcp_generator/templates/test/test_behavioral.py +838 -0
- mcp_generator-3.2.1/mcp_generator/templates/test/test_cache.py +280 -0
- mcp_generator-3.2.1/mcp_generator/templates/test/test_e2e_http_basic.py +548 -0
- mcp_generator-3.2.1/mcp_generator/templates/test/test_e2e_openapi_features.py +662 -0
- mcp_generator-3.2.1/mcp_generator/templates/test/test_e2e_performance.py +502 -0
- mcp_generator-3.2.1/mcp_generator/templates/test/test_multi_auth.py +217 -0
- mcp_generator-3.2.1/mcp_generator/templates/test/test_oauth_persistence.py +326 -0
- mcp_generator-3.2.1/mcp_generator/templates/test/test_resources.py +253 -0
- mcp_generator-3.2.1/mcp_generator/templates/test/test_runner.py +376 -0
- mcp_generator-3.2.1/mcp_generator/templates/test/test_server_integration.py +516 -0
- mcp_generator-3.2.1/mcp_generator/templates/test/test_tool_schemas.py +285 -0
- mcp_generator-3.2.1/mcp_generator/templates/test/test_tools.py +178 -0
- mcp_generator-3.2.1/mcp_generator/templates/test/test_transforms.py +228 -0
- mcp_generator-3.2.1/mcp_generator/test_generator.py +372 -0
- mcp_generator-3.2.1/mcp_generator/utils.py +220 -0
- mcp_generator-3.2.1/mcp_generator/writers.py +713 -0
- mcp_generator-3.2.1/mkdocs.yml +110 -0
- mcp_generator-3.2.1/pyproject.toml +137 -0
- mcp_generator-3.2.1/scripts/test_examples.py +334 -0
- mcp_generator-3.2.1/scripts/workflows/categorize_commits.py +95 -0
- mcp_generator-3.2.1/scripts/workflows/generate_changelog_ai.py +227 -0
- mcp_generator-3.2.1/scripts/workflows/summarize_diff.py +294 -0
- mcp_generator-3.2.1/scripts/workflows/update_version_metadata.py +502 -0
- mcp_generator-3.2.1/test/__init__.py +0 -0
- mcp_generator-3.2.1/test/conftest.py +178 -0
- mcp_generator-3.2.1/test/run_tests.py +370 -0
- mcp_generator-3.2.1/test/test_a2a.py +116 -0
- mcp_generator-3.2.1/test/test_display_renderers.py +492 -0
- mcp_generator-3.2.1/test/test_display_tools.py +513 -0
- mcp_generator-3.2.1/test/test_generator.py +521 -0
- mcp_generator-3.2.1/test/test_introspection.py +98 -0
- mcp_generator-3.2.1/test/test_models.py +133 -0
- mcp_generator-3.2.1/test/test_overlay.py +225 -0
- mcp_generator-3.2.1/test/test_renderers.py +502 -0
- mcp_generator-3.2.1/test/test_templates.py +510 -0
- mcp_generator-3.2.1/test/test_utils.py +111 -0
- mcp_generator-3.2.1/uv.lock +2178 -0
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
import { FhirResourceReader } from "./reader.js";
|
|
2
|
+
import { FhirResourceWriter } from "./writer.js";
|
|
3
|
+
import type { FetchFn, SearchParams } from "./types.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* FHIR R4 read client with typed accessors for all base resource types.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const reader = new FhirReadClient("https://fhir.example.com");
|
|
10
|
+
* const pt = await reader.patient().read("123");
|
|
11
|
+
*/
|
|
12
|
+
export class FhirReadClient {
|
|
13
|
+
constructor(
|
|
14
|
+
protected readonly baseUrl: string,
|
|
15
|
+
protected readonly fetchFn?: FetchFn,
|
|
16
|
+
) {}
|
|
17
|
+
|
|
18
|
+
/** Get a typed resource reader for any FHIR resource type, including profile types from other generated packages. */
|
|
19
|
+
forType<T extends fhir4.Resource, S extends SearchParams = SearchParams>(resourceType: string) {
|
|
20
|
+
return new FhirResourceReader<T, S>(this.baseUrl, resourceType, this.fetchFn);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
account() { return this.forType<fhir4.Account>("Account"); }
|
|
24
|
+
activityDefinition() { return this.forType<fhir4.ActivityDefinition>("ActivityDefinition"); }
|
|
25
|
+
adverseEvent() { return this.forType<fhir4.AdverseEvent>("AdverseEvent"); }
|
|
26
|
+
allergyIntolerance() { return this.forType<fhir4.AllergyIntolerance>("AllergyIntolerance"); }
|
|
27
|
+
appointment() { return this.forType<fhir4.Appointment>("Appointment"); }
|
|
28
|
+
appointmentResponse() { return this.forType<fhir4.AppointmentResponse>("AppointmentResponse"); }
|
|
29
|
+
auditEvent() { return this.forType<fhir4.AuditEvent>("AuditEvent"); }
|
|
30
|
+
basic() { return this.forType<fhir4.Basic>("Basic"); }
|
|
31
|
+
binary() { return this.forType<fhir4.Binary>("Binary"); }
|
|
32
|
+
biologicallyDerivedProduct() { return this.forType<fhir4.BiologicallyDerivedProduct>("BiologicallyDerivedProduct"); }
|
|
33
|
+
bodyStructure() { return this.forType<fhir4.BodyStructure>("BodyStructure"); }
|
|
34
|
+
bundle() { return this.forType<fhir4.Bundle>("Bundle"); }
|
|
35
|
+
capabilityStatement() { return this.forType<fhir4.CapabilityStatement>("CapabilityStatement"); }
|
|
36
|
+
carePlan() { return this.forType<fhir4.CarePlan>("CarePlan"); }
|
|
37
|
+
careTeam() { return this.forType<fhir4.CareTeam>("CareTeam"); }
|
|
38
|
+
catalogEntry() { return this.forType<fhir4.CatalogEntry>("CatalogEntry"); }
|
|
39
|
+
chargeItem() { return this.forType<fhir4.ChargeItem>("ChargeItem"); }
|
|
40
|
+
chargeItemDefinition() { return this.forType<fhir4.ChargeItemDefinition>("ChargeItemDefinition"); }
|
|
41
|
+
claim() { return this.forType<fhir4.Claim>("Claim"); }
|
|
42
|
+
claimResponse() { return this.forType<fhir4.ClaimResponse>("ClaimResponse"); }
|
|
43
|
+
clinicalImpression() { return this.forType<fhir4.ClinicalImpression>("ClinicalImpression"); }
|
|
44
|
+
codeSystem() { return this.forType<fhir4.CodeSystem>("CodeSystem"); }
|
|
45
|
+
communication() { return this.forType<fhir4.Communication>("Communication"); }
|
|
46
|
+
communicationRequest() { return this.forType<fhir4.CommunicationRequest>("CommunicationRequest"); }
|
|
47
|
+
compartmentDefinition() { return this.forType<fhir4.CompartmentDefinition>("CompartmentDefinition"); }
|
|
48
|
+
composition() { return this.forType<fhir4.Composition>("Composition"); }
|
|
49
|
+
conceptMap() { return this.forType<fhir4.ConceptMap>("ConceptMap"); }
|
|
50
|
+
condition() { return this.forType<fhir4.Condition>("Condition"); }
|
|
51
|
+
consent() { return this.forType<fhir4.Consent>("Consent"); }
|
|
52
|
+
contract() { return this.forType<fhir4.Contract>("Contract"); }
|
|
53
|
+
coverage() { return this.forType<fhir4.Coverage>("Coverage"); }
|
|
54
|
+
coverageEligibilityRequest() { return this.forType<fhir4.CoverageEligibilityRequest>("CoverageEligibilityRequest"); }
|
|
55
|
+
coverageEligibilityResponse() { return this.forType<fhir4.CoverageEligibilityResponse>("CoverageEligibilityResponse"); }
|
|
56
|
+
detectedIssue() { return this.forType<fhir4.DetectedIssue>("DetectedIssue"); }
|
|
57
|
+
device() { return this.forType<fhir4.Device>("Device"); }
|
|
58
|
+
deviceDefinition() { return this.forType<fhir4.DeviceDefinition>("DeviceDefinition"); }
|
|
59
|
+
deviceMetric() { return this.forType<fhir4.DeviceMetric>("DeviceMetric"); }
|
|
60
|
+
deviceRequest() { return this.forType<fhir4.DeviceRequest>("DeviceRequest"); }
|
|
61
|
+
deviceUseStatement() { return this.forType<fhir4.DeviceUseStatement>("DeviceUseStatement"); }
|
|
62
|
+
diagnosticReport() { return this.forType<fhir4.DiagnosticReport>("DiagnosticReport"); }
|
|
63
|
+
documentManifest() { return this.forType<fhir4.DocumentManifest>("DocumentManifest"); }
|
|
64
|
+
documentReference() { return this.forType<fhir4.DocumentReference>("DocumentReference"); }
|
|
65
|
+
effectEvidenceSynthesis() { return this.forType<fhir4.EffectEvidenceSynthesis>("EffectEvidenceSynthesis"); }
|
|
66
|
+
encounter() { return this.forType<fhir4.Encounter>("Encounter"); }
|
|
67
|
+
endpoint() { return this.forType<fhir4.Endpoint>("Endpoint"); }
|
|
68
|
+
enrollmentRequest() { return this.forType<fhir4.EnrollmentRequest>("EnrollmentRequest"); }
|
|
69
|
+
enrollmentResponse() { return this.forType<fhir4.EnrollmentResponse>("EnrollmentResponse"); }
|
|
70
|
+
episodeOfCare() { return this.forType<fhir4.EpisodeOfCare>("EpisodeOfCare"); }
|
|
71
|
+
eventDefinition() { return this.forType<fhir4.EventDefinition>("EventDefinition"); }
|
|
72
|
+
evidence() { return this.forType<fhir4.Evidence>("Evidence"); }
|
|
73
|
+
evidenceVariable() { return this.forType<fhir4.EvidenceVariable>("EvidenceVariable"); }
|
|
74
|
+
exampleScenario() { return this.forType<fhir4.ExampleScenario>("ExampleScenario"); }
|
|
75
|
+
explanationOfBenefit() { return this.forType<fhir4.ExplanationOfBenefit>("ExplanationOfBenefit"); }
|
|
76
|
+
familyMemberHistory() { return this.forType<fhir4.FamilyMemberHistory>("FamilyMemberHistory"); }
|
|
77
|
+
flag() { return this.forType<fhir4.Flag>("Flag"); }
|
|
78
|
+
goal() { return this.forType<fhir4.Goal>("Goal"); }
|
|
79
|
+
graphDefinition() { return this.forType<fhir4.GraphDefinition>("GraphDefinition"); }
|
|
80
|
+
group() { return this.forType<fhir4.Group>("Group"); }
|
|
81
|
+
guidanceResponse() { return this.forType<fhir4.GuidanceResponse>("GuidanceResponse"); }
|
|
82
|
+
healthcareService() { return this.forType<fhir4.HealthcareService>("HealthcareService"); }
|
|
83
|
+
imagingStudy() { return this.forType<fhir4.ImagingStudy>("ImagingStudy"); }
|
|
84
|
+
immunization() { return this.forType<fhir4.Immunization>("Immunization"); }
|
|
85
|
+
immunizationEvaluation() { return this.forType<fhir4.ImmunizationEvaluation>("ImmunizationEvaluation"); }
|
|
86
|
+
immunizationRecommendation() { return this.forType<fhir4.ImmunizationRecommendation>("ImmunizationRecommendation"); }
|
|
87
|
+
implementationGuide() { return this.forType<fhir4.ImplementationGuide>("ImplementationGuide"); }
|
|
88
|
+
insurancePlan() { return this.forType<fhir4.InsurancePlan>("InsurancePlan"); }
|
|
89
|
+
invoice() { return this.forType<fhir4.Invoice>("Invoice"); }
|
|
90
|
+
library() { return this.forType<fhir4.Library>("Library"); }
|
|
91
|
+
linkage() { return this.forType<fhir4.Linkage>("Linkage"); }
|
|
92
|
+
list() { return this.forType<fhir4.List>("List"); }
|
|
93
|
+
location() { return this.forType<fhir4.Location>("Location"); }
|
|
94
|
+
measure() { return this.forType<fhir4.Measure>("Measure"); }
|
|
95
|
+
measureReport() { return this.forType<fhir4.MeasureReport>("MeasureReport"); }
|
|
96
|
+
media() { return this.forType<fhir4.Media>("Media"); }
|
|
97
|
+
medication() { return this.forType<fhir4.Medication>("Medication"); }
|
|
98
|
+
medicationAdministration() { return this.forType<fhir4.MedicationAdministration>("MedicationAdministration"); }
|
|
99
|
+
medicationDispense() { return this.forType<fhir4.MedicationDispense>("MedicationDispense"); }
|
|
100
|
+
medicationKnowledge() { return this.forType<fhir4.MedicationKnowledge>("MedicationKnowledge"); }
|
|
101
|
+
medicationRequest() { return this.forType<fhir4.MedicationRequest>("MedicationRequest"); }
|
|
102
|
+
medicationStatement() { return this.forType<fhir4.MedicationStatement>("MedicationStatement"); }
|
|
103
|
+
medicinalProduct() { return this.forType<fhir4.MedicinalProduct>("MedicinalProduct"); }
|
|
104
|
+
medicinalProductAuthorization() { return this.forType<fhir4.MedicinalProductAuthorization>("MedicinalProductAuthorization"); }
|
|
105
|
+
medicinalProductContraindication() { return this.forType<fhir4.MedicinalProductContraindication>("MedicinalProductContraindication"); }
|
|
106
|
+
medicinalProductIndication() { return this.forType<fhir4.MedicinalProductIndication>("MedicinalProductIndication"); }
|
|
107
|
+
medicinalProductIngredient() { return this.forType<fhir4.MedicinalProductIngredient>("MedicinalProductIngredient"); }
|
|
108
|
+
medicinalProductInteraction() { return this.forType<fhir4.MedicinalProductInteraction>("MedicinalProductInteraction"); }
|
|
109
|
+
medicinalProductManufactured() { return this.forType<fhir4.MedicinalProductManufactured>("MedicinalProductManufactured"); }
|
|
110
|
+
medicinalProductPackaged() { return this.forType<fhir4.MedicinalProductPackaged>("MedicinalProductPackaged"); }
|
|
111
|
+
medicinalProductPharmaceutical() { return this.forType<fhir4.MedicinalProductPharmaceutical>("MedicinalProductPharmaceutical"); }
|
|
112
|
+
medicinalProductUndesirableEffect() { return this.forType<fhir4.MedicinalProductUndesirableEffect>("MedicinalProductUndesirableEffect"); }
|
|
113
|
+
messageDefinition() { return this.forType<fhir4.MessageDefinition>("MessageDefinition"); }
|
|
114
|
+
messageHeader() { return this.forType<fhir4.MessageHeader>("MessageHeader"); }
|
|
115
|
+
molecularSequence() { return this.forType<fhir4.MolecularSequence>("MolecularSequence"); }
|
|
116
|
+
namingSystem() { return this.forType<fhir4.NamingSystem>("NamingSystem"); }
|
|
117
|
+
nutritionOrder() { return this.forType<fhir4.NutritionOrder>("NutritionOrder"); }
|
|
118
|
+
observation() { return this.forType<fhir4.Observation>("Observation"); }
|
|
119
|
+
observationDefinition() { return this.forType<fhir4.ObservationDefinition>("ObservationDefinition"); }
|
|
120
|
+
operationDefinition() { return this.forType<fhir4.OperationDefinition>("OperationDefinition"); }
|
|
121
|
+
operationOutcome() { return this.forType<fhir4.OperationOutcome>("OperationOutcome"); }
|
|
122
|
+
organization() { return this.forType<fhir4.Organization>("Organization"); }
|
|
123
|
+
organizationAffiliation() { return this.forType<fhir4.OrganizationAffiliation>("OrganizationAffiliation"); }
|
|
124
|
+
patient() { return this.forType<fhir4.Patient>("Patient"); }
|
|
125
|
+
paymentNotice() { return this.forType<fhir4.PaymentNotice>("PaymentNotice"); }
|
|
126
|
+
paymentReconciliation() { return this.forType<fhir4.PaymentReconciliation>("PaymentReconciliation"); }
|
|
127
|
+
person() { return this.forType<fhir4.Person>("Person"); }
|
|
128
|
+
planDefinition() { return this.forType<fhir4.PlanDefinition>("PlanDefinition"); }
|
|
129
|
+
practitioner() { return this.forType<fhir4.Practitioner>("Practitioner"); }
|
|
130
|
+
practitionerRole() { return this.forType<fhir4.PractitionerRole>("PractitionerRole"); }
|
|
131
|
+
procedure() { return this.forType<fhir4.Procedure>("Procedure"); }
|
|
132
|
+
provenance() { return this.forType<fhir4.Provenance>("Provenance"); }
|
|
133
|
+
questionnaire() { return this.forType<fhir4.Questionnaire>("Questionnaire"); }
|
|
134
|
+
questionnaireResponse() { return this.forType<fhir4.QuestionnaireResponse>("QuestionnaireResponse"); }
|
|
135
|
+
relatedPerson() { return this.forType<fhir4.RelatedPerson>("RelatedPerson"); }
|
|
136
|
+
requestGroup() { return this.forType<fhir4.RequestGroup>("RequestGroup"); }
|
|
137
|
+
researchDefinition() { return this.forType<fhir4.ResearchDefinition>("ResearchDefinition"); }
|
|
138
|
+
researchElementDefinition() { return this.forType<fhir4.ResearchElementDefinition>("ResearchElementDefinition"); }
|
|
139
|
+
researchStudy() { return this.forType<fhir4.ResearchStudy>("ResearchStudy"); }
|
|
140
|
+
researchSubject() { return this.forType<fhir4.ResearchSubject>("ResearchSubject"); }
|
|
141
|
+
riskAssessment() { return this.forType<fhir4.RiskAssessment>("RiskAssessment"); }
|
|
142
|
+
riskEvidenceSynthesis() { return this.forType<fhir4.RiskEvidenceSynthesis>("RiskEvidenceSynthesis"); }
|
|
143
|
+
schedule() { return this.forType<fhir4.Schedule>("Schedule"); }
|
|
144
|
+
searchParameter() { return this.forType<fhir4.SearchParameter>("SearchParameter"); }
|
|
145
|
+
serviceRequest() { return this.forType<fhir4.ServiceRequest>("ServiceRequest"); }
|
|
146
|
+
slot() { return this.forType<fhir4.Slot>("Slot"); }
|
|
147
|
+
specimen() { return this.forType<fhir4.Specimen>("Specimen"); }
|
|
148
|
+
specimenDefinition() { return this.forType<fhir4.SpecimenDefinition>("SpecimenDefinition"); }
|
|
149
|
+
structureDefinition() { return this.forType<fhir4.StructureDefinition>("StructureDefinition"); }
|
|
150
|
+
structureMap() { return this.forType<fhir4.StructureMap>("StructureMap"); }
|
|
151
|
+
subscription() { return this.forType<fhir4.Subscription>("Subscription"); }
|
|
152
|
+
substance() { return this.forType<fhir4.Substance>("Substance"); }
|
|
153
|
+
substanceNucleicAcid() { return this.forType<fhir4.SubstanceNucleicAcid>("SubstanceNucleicAcid"); }
|
|
154
|
+
substancePolymer() { return this.forType<fhir4.SubstancePolymer>("SubstancePolymer"); }
|
|
155
|
+
substanceProtein() { return this.forType<fhir4.SubstanceProtein>("SubstanceProtein"); }
|
|
156
|
+
substanceReferenceInformation() { return this.forType<fhir4.SubstanceReferenceInformation>("SubstanceReferenceInformation"); }
|
|
157
|
+
substanceSourceMaterial() { return this.forType<fhir4.SubstanceSourceMaterial>("SubstanceSourceMaterial"); }
|
|
158
|
+
substanceSpecification() { return this.forType<fhir4.SubstanceSpecification>("SubstanceSpecification"); }
|
|
159
|
+
supplyDelivery() { return this.forType<fhir4.SupplyDelivery>("SupplyDelivery"); }
|
|
160
|
+
supplyRequest() { return this.forType<fhir4.SupplyRequest>("SupplyRequest"); }
|
|
161
|
+
task() { return this.forType<fhir4.Task>("Task"); }
|
|
162
|
+
terminologyCapabilities() { return this.forType<fhir4.TerminologyCapabilities>("TerminologyCapabilities"); }
|
|
163
|
+
testReport() { return this.forType<fhir4.TestReport>("TestReport"); }
|
|
164
|
+
testScript() { return this.forType<fhir4.TestScript>("TestScript"); }
|
|
165
|
+
valueSet() { return this.forType<fhir4.ValueSet>("ValueSet"); }
|
|
166
|
+
verificationResult() { return this.forType<fhir4.VerificationResult>("VerificationResult"); }
|
|
167
|
+
visionPrescription() { return this.forType<fhir4.VisionPrescription>("VisionPrescription"); }
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* FHIR R4 write client with typed accessors for all base resource types.
|
|
172
|
+
*/
|
|
173
|
+
export class FhirWriteClient {
|
|
174
|
+
constructor(
|
|
175
|
+
protected readonly baseUrl: string,
|
|
176
|
+
protected readonly fetchFn?: FetchFn,
|
|
177
|
+
) {}
|
|
178
|
+
|
|
179
|
+
/** Get a typed resource writer for any FHIR resource type, including profile types from other generated packages. */
|
|
180
|
+
forType<T extends fhir4.Resource>(resourceType: string) {
|
|
181
|
+
return new FhirResourceWriter<T>(this.baseUrl, resourceType, this.fetchFn);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
account() { return this.forType<fhir4.Account>("Account"); }
|
|
185
|
+
activityDefinition() { return this.forType<fhir4.ActivityDefinition>("ActivityDefinition"); }
|
|
186
|
+
adverseEvent() { return this.forType<fhir4.AdverseEvent>("AdverseEvent"); }
|
|
187
|
+
allergyIntolerance() { return this.forType<fhir4.AllergyIntolerance>("AllergyIntolerance"); }
|
|
188
|
+
appointment() { return this.forType<fhir4.Appointment>("Appointment"); }
|
|
189
|
+
appointmentResponse() { return this.forType<fhir4.AppointmentResponse>("AppointmentResponse"); }
|
|
190
|
+
auditEvent() { return this.forType<fhir4.AuditEvent>("AuditEvent"); }
|
|
191
|
+
basic() { return this.forType<fhir4.Basic>("Basic"); }
|
|
192
|
+
binary() { return this.forType<fhir4.Binary>("Binary"); }
|
|
193
|
+
biologicallyDerivedProduct() { return this.forType<fhir4.BiologicallyDerivedProduct>("BiologicallyDerivedProduct"); }
|
|
194
|
+
bodyStructure() { return this.forType<fhir4.BodyStructure>("BodyStructure"); }
|
|
195
|
+
bundle() { return this.forType<fhir4.Bundle>("Bundle"); }
|
|
196
|
+
capabilityStatement() { return this.forType<fhir4.CapabilityStatement>("CapabilityStatement"); }
|
|
197
|
+
carePlan() { return this.forType<fhir4.CarePlan>("CarePlan"); }
|
|
198
|
+
careTeam() { return this.forType<fhir4.CareTeam>("CareTeam"); }
|
|
199
|
+
catalogEntry() { return this.forType<fhir4.CatalogEntry>("CatalogEntry"); }
|
|
200
|
+
chargeItem() { return this.forType<fhir4.ChargeItem>("ChargeItem"); }
|
|
201
|
+
chargeItemDefinition() { return this.forType<fhir4.ChargeItemDefinition>("ChargeItemDefinition"); }
|
|
202
|
+
claim() { return this.forType<fhir4.Claim>("Claim"); }
|
|
203
|
+
claimResponse() { return this.forType<fhir4.ClaimResponse>("ClaimResponse"); }
|
|
204
|
+
clinicalImpression() { return this.forType<fhir4.ClinicalImpression>("ClinicalImpression"); }
|
|
205
|
+
codeSystem() { return this.forType<fhir4.CodeSystem>("CodeSystem"); }
|
|
206
|
+
communication() { return this.forType<fhir4.Communication>("Communication"); }
|
|
207
|
+
communicationRequest() { return this.forType<fhir4.CommunicationRequest>("CommunicationRequest"); }
|
|
208
|
+
compartmentDefinition() { return this.forType<fhir4.CompartmentDefinition>("CompartmentDefinition"); }
|
|
209
|
+
composition() { return this.forType<fhir4.Composition>("Composition"); }
|
|
210
|
+
conceptMap() { return this.forType<fhir4.ConceptMap>("ConceptMap"); }
|
|
211
|
+
condition() { return this.forType<fhir4.Condition>("Condition"); }
|
|
212
|
+
consent() { return this.forType<fhir4.Consent>("Consent"); }
|
|
213
|
+
contract() { return this.forType<fhir4.Contract>("Contract"); }
|
|
214
|
+
coverage() { return this.forType<fhir4.Coverage>("Coverage"); }
|
|
215
|
+
coverageEligibilityRequest() { return this.forType<fhir4.CoverageEligibilityRequest>("CoverageEligibilityRequest"); }
|
|
216
|
+
coverageEligibilityResponse() { return this.forType<fhir4.CoverageEligibilityResponse>("CoverageEligibilityResponse"); }
|
|
217
|
+
detectedIssue() { return this.forType<fhir4.DetectedIssue>("DetectedIssue"); }
|
|
218
|
+
device() { return this.forType<fhir4.Device>("Device"); }
|
|
219
|
+
deviceDefinition() { return this.forType<fhir4.DeviceDefinition>("DeviceDefinition"); }
|
|
220
|
+
deviceMetric() { return this.forType<fhir4.DeviceMetric>("DeviceMetric"); }
|
|
221
|
+
deviceRequest() { return this.forType<fhir4.DeviceRequest>("DeviceRequest"); }
|
|
222
|
+
deviceUseStatement() { return this.forType<fhir4.DeviceUseStatement>("DeviceUseStatement"); }
|
|
223
|
+
diagnosticReport() { return this.forType<fhir4.DiagnosticReport>("DiagnosticReport"); }
|
|
224
|
+
documentManifest() { return this.forType<fhir4.DocumentManifest>("DocumentManifest"); }
|
|
225
|
+
documentReference() { return this.forType<fhir4.DocumentReference>("DocumentReference"); }
|
|
226
|
+
effectEvidenceSynthesis() { return this.forType<fhir4.EffectEvidenceSynthesis>("EffectEvidenceSynthesis"); }
|
|
227
|
+
encounter() { return this.forType<fhir4.Encounter>("Encounter"); }
|
|
228
|
+
endpoint() { return this.forType<fhir4.Endpoint>("Endpoint"); }
|
|
229
|
+
enrollmentRequest() { return this.forType<fhir4.EnrollmentRequest>("EnrollmentRequest"); }
|
|
230
|
+
enrollmentResponse() { return this.forType<fhir4.EnrollmentResponse>("EnrollmentResponse"); }
|
|
231
|
+
episodeOfCare() { return this.forType<fhir4.EpisodeOfCare>("EpisodeOfCare"); }
|
|
232
|
+
eventDefinition() { return this.forType<fhir4.EventDefinition>("EventDefinition"); }
|
|
233
|
+
evidence() { return this.forType<fhir4.Evidence>("Evidence"); }
|
|
234
|
+
evidenceVariable() { return this.forType<fhir4.EvidenceVariable>("EvidenceVariable"); }
|
|
235
|
+
exampleScenario() { return this.forType<fhir4.ExampleScenario>("ExampleScenario"); }
|
|
236
|
+
explanationOfBenefit() { return this.forType<fhir4.ExplanationOfBenefit>("ExplanationOfBenefit"); }
|
|
237
|
+
familyMemberHistory() { return this.forType<fhir4.FamilyMemberHistory>("FamilyMemberHistory"); }
|
|
238
|
+
flag() { return this.forType<fhir4.Flag>("Flag"); }
|
|
239
|
+
goal() { return this.forType<fhir4.Goal>("Goal"); }
|
|
240
|
+
graphDefinition() { return this.forType<fhir4.GraphDefinition>("GraphDefinition"); }
|
|
241
|
+
group() { return this.forType<fhir4.Group>("Group"); }
|
|
242
|
+
guidanceResponse() { return this.forType<fhir4.GuidanceResponse>("GuidanceResponse"); }
|
|
243
|
+
healthcareService() { return this.forType<fhir4.HealthcareService>("HealthcareService"); }
|
|
244
|
+
imagingStudy() { return this.forType<fhir4.ImagingStudy>("ImagingStudy"); }
|
|
245
|
+
immunization() { return this.forType<fhir4.Immunization>("Immunization"); }
|
|
246
|
+
immunizationEvaluation() { return this.forType<fhir4.ImmunizationEvaluation>("ImmunizationEvaluation"); }
|
|
247
|
+
immunizationRecommendation() { return this.forType<fhir4.ImmunizationRecommendation>("ImmunizationRecommendation"); }
|
|
248
|
+
implementationGuide() { return this.forType<fhir4.ImplementationGuide>("ImplementationGuide"); }
|
|
249
|
+
insurancePlan() { return this.forType<fhir4.InsurancePlan>("InsurancePlan"); }
|
|
250
|
+
invoice() { return this.forType<fhir4.Invoice>("Invoice"); }
|
|
251
|
+
library() { return this.forType<fhir4.Library>("Library"); }
|
|
252
|
+
linkage() { return this.forType<fhir4.Linkage>("Linkage"); }
|
|
253
|
+
list() { return this.forType<fhir4.List>("List"); }
|
|
254
|
+
location() { return this.forType<fhir4.Location>("Location"); }
|
|
255
|
+
measure() { return this.forType<fhir4.Measure>("Measure"); }
|
|
256
|
+
measureReport() { return this.forType<fhir4.MeasureReport>("MeasureReport"); }
|
|
257
|
+
media() { return this.forType<fhir4.Media>("Media"); }
|
|
258
|
+
medication() { return this.forType<fhir4.Medication>("Medication"); }
|
|
259
|
+
medicationAdministration() { return this.forType<fhir4.MedicationAdministration>("MedicationAdministration"); }
|
|
260
|
+
medicationDispense() { return this.forType<fhir4.MedicationDispense>("MedicationDispense"); }
|
|
261
|
+
medicationKnowledge() { return this.forType<fhir4.MedicationKnowledge>("MedicationKnowledge"); }
|
|
262
|
+
medicationRequest() { return this.forType<fhir4.MedicationRequest>("MedicationRequest"); }
|
|
263
|
+
medicationStatement() { return this.forType<fhir4.MedicationStatement>("MedicationStatement"); }
|
|
264
|
+
medicinalProduct() { return this.forType<fhir4.MedicinalProduct>("MedicinalProduct"); }
|
|
265
|
+
medicinalProductAuthorization() { return this.forType<fhir4.MedicinalProductAuthorization>("MedicinalProductAuthorization"); }
|
|
266
|
+
medicinalProductContraindication() { return this.forType<fhir4.MedicinalProductContraindication>("MedicinalProductContraindication"); }
|
|
267
|
+
medicinalProductIndication() { return this.forType<fhir4.MedicinalProductIndication>("MedicinalProductIndication"); }
|
|
268
|
+
medicinalProductIngredient() { return this.forType<fhir4.MedicinalProductIngredient>("MedicinalProductIngredient"); }
|
|
269
|
+
medicinalProductInteraction() { return this.forType<fhir4.MedicinalProductInteraction>("MedicinalProductInteraction"); }
|
|
270
|
+
medicinalProductManufactured() { return this.forType<fhir4.MedicinalProductManufactured>("MedicinalProductManufactured"); }
|
|
271
|
+
medicinalProductPackaged() { return this.forType<fhir4.MedicinalProductPackaged>("MedicinalProductPackaged"); }
|
|
272
|
+
medicinalProductPharmaceutical() { return this.forType<fhir4.MedicinalProductPharmaceutical>("MedicinalProductPharmaceutical"); }
|
|
273
|
+
medicinalProductUndesirableEffect() { return this.forType<fhir4.MedicinalProductUndesirableEffect>("MedicinalProductUndesirableEffect"); }
|
|
274
|
+
messageDefinition() { return this.forType<fhir4.MessageDefinition>("MessageDefinition"); }
|
|
275
|
+
messageHeader() { return this.forType<fhir4.MessageHeader>("MessageHeader"); }
|
|
276
|
+
molecularSequence() { return this.forType<fhir4.MolecularSequence>("MolecularSequence"); }
|
|
277
|
+
namingSystem() { return this.forType<fhir4.NamingSystem>("NamingSystem"); }
|
|
278
|
+
nutritionOrder() { return this.forType<fhir4.NutritionOrder>("NutritionOrder"); }
|
|
279
|
+
observation() { return this.forType<fhir4.Observation>("Observation"); }
|
|
280
|
+
observationDefinition() { return this.forType<fhir4.ObservationDefinition>("ObservationDefinition"); }
|
|
281
|
+
operationDefinition() { return this.forType<fhir4.OperationDefinition>("OperationDefinition"); }
|
|
282
|
+
operationOutcome() { return this.forType<fhir4.OperationOutcome>("OperationOutcome"); }
|
|
283
|
+
organization() { return this.forType<fhir4.Organization>("Organization"); }
|
|
284
|
+
organizationAffiliation() { return this.forType<fhir4.OrganizationAffiliation>("OrganizationAffiliation"); }
|
|
285
|
+
patient() { return this.forType<fhir4.Patient>("Patient"); }
|
|
286
|
+
paymentNotice() { return this.forType<fhir4.PaymentNotice>("PaymentNotice"); }
|
|
287
|
+
paymentReconciliation() { return this.forType<fhir4.PaymentReconciliation>("PaymentReconciliation"); }
|
|
288
|
+
person() { return this.forType<fhir4.Person>("Person"); }
|
|
289
|
+
planDefinition() { return this.forType<fhir4.PlanDefinition>("PlanDefinition"); }
|
|
290
|
+
practitioner() { return this.forType<fhir4.Practitioner>("Practitioner"); }
|
|
291
|
+
practitionerRole() { return this.forType<fhir4.PractitionerRole>("PractitionerRole"); }
|
|
292
|
+
procedure() { return this.forType<fhir4.Procedure>("Procedure"); }
|
|
293
|
+
provenance() { return this.forType<fhir4.Provenance>("Provenance"); }
|
|
294
|
+
questionnaire() { return this.forType<fhir4.Questionnaire>("Questionnaire"); }
|
|
295
|
+
questionnaireResponse() { return this.forType<fhir4.QuestionnaireResponse>("QuestionnaireResponse"); }
|
|
296
|
+
relatedPerson() { return this.forType<fhir4.RelatedPerson>("RelatedPerson"); }
|
|
297
|
+
requestGroup() { return this.forType<fhir4.RequestGroup>("RequestGroup"); }
|
|
298
|
+
researchDefinition() { return this.forType<fhir4.ResearchDefinition>("ResearchDefinition"); }
|
|
299
|
+
researchElementDefinition() { return this.forType<fhir4.ResearchElementDefinition>("ResearchElementDefinition"); }
|
|
300
|
+
researchStudy() { return this.forType<fhir4.ResearchStudy>("ResearchStudy"); }
|
|
301
|
+
researchSubject() { return this.forType<fhir4.ResearchSubject>("ResearchSubject"); }
|
|
302
|
+
riskAssessment() { return this.forType<fhir4.RiskAssessment>("RiskAssessment"); }
|
|
303
|
+
riskEvidenceSynthesis() { return this.forType<fhir4.RiskEvidenceSynthesis>("RiskEvidenceSynthesis"); }
|
|
304
|
+
schedule() { return this.forType<fhir4.Schedule>("Schedule"); }
|
|
305
|
+
searchParameter() { return this.forType<fhir4.SearchParameter>("SearchParameter"); }
|
|
306
|
+
serviceRequest() { return this.forType<fhir4.ServiceRequest>("ServiceRequest"); }
|
|
307
|
+
slot() { return this.forType<fhir4.Slot>("Slot"); }
|
|
308
|
+
specimen() { return this.forType<fhir4.Specimen>("Specimen"); }
|
|
309
|
+
specimenDefinition() { return this.forType<fhir4.SpecimenDefinition>("SpecimenDefinition"); }
|
|
310
|
+
structureDefinition() { return this.forType<fhir4.StructureDefinition>("StructureDefinition"); }
|
|
311
|
+
structureMap() { return this.forType<fhir4.StructureMap>("StructureMap"); }
|
|
312
|
+
subscription() { return this.forType<fhir4.Subscription>("Subscription"); }
|
|
313
|
+
substance() { return this.forType<fhir4.Substance>("Substance"); }
|
|
314
|
+
substanceNucleicAcid() { return this.forType<fhir4.SubstanceNucleicAcid>("SubstanceNucleicAcid"); }
|
|
315
|
+
substancePolymer() { return this.forType<fhir4.SubstancePolymer>("SubstancePolymer"); }
|
|
316
|
+
substanceProtein() { return this.forType<fhir4.SubstanceProtein>("SubstanceProtein"); }
|
|
317
|
+
substanceReferenceInformation() { return this.forType<fhir4.SubstanceReferenceInformation>("SubstanceReferenceInformation"); }
|
|
318
|
+
substanceSourceMaterial() { return this.forType<fhir4.SubstanceSourceMaterial>("SubstanceSourceMaterial"); }
|
|
319
|
+
substanceSpecification() { return this.forType<fhir4.SubstanceSpecification>("SubstanceSpecification"); }
|
|
320
|
+
supplyDelivery() { return this.forType<fhir4.SupplyDelivery>("SupplyDelivery"); }
|
|
321
|
+
supplyRequest() { return this.forType<fhir4.SupplyRequest>("SupplyRequest"); }
|
|
322
|
+
task() { return this.forType<fhir4.Task>("Task"); }
|
|
323
|
+
terminologyCapabilities() { return this.forType<fhir4.TerminologyCapabilities>("TerminologyCapabilities"); }
|
|
324
|
+
testReport() { return this.forType<fhir4.TestReport>("TestReport"); }
|
|
325
|
+
testScript() { return this.forType<fhir4.TestScript>("TestScript"); }
|
|
326
|
+
valueSet() { return this.forType<fhir4.ValueSet>("ValueSet"); }
|
|
327
|
+
verificationResult() { return this.forType<fhir4.VerificationResult>("VerificationResult"); }
|
|
328
|
+
visionPrescription() { return this.forType<fhir4.VisionPrescription>("VisionPrescription"); }
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Main FHIR R4 Client with typed read and write accessors.
|
|
333
|
+
*
|
|
334
|
+
* @example
|
|
335
|
+
* const client = new FhirClient("https://fhir.example.com");
|
|
336
|
+
* const pt = await client.read().patient().read("123");
|
|
337
|
+
* await client.write().patient().create({ resourceType: "Patient", ... });
|
|
338
|
+
*/
|
|
339
|
+
export class FhirClient {
|
|
340
|
+
private readonly _read: FhirReadClient;
|
|
341
|
+
private readonly _write: FhirWriteClient;
|
|
342
|
+
|
|
343
|
+
constructor(public readonly baseUrl: string, fetchFn?: FetchFn) {
|
|
344
|
+
this._read = new FhirReadClient(baseUrl, fetchFn);
|
|
345
|
+
this._write = new FhirWriteClient(baseUrl, fetchFn);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
read() { return this._read; }
|
|
349
|
+
write() { return this._write; }
|
|
350
|
+
}
|