emuhealth 0.5.0 → 0.6.0

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.
package/README.md CHANGED
@@ -38,6 +38,14 @@ All services listen on IPv4 loopback (`127.0.0.1`) by default. No config file ne
38
38
  Health and life science services use a fixed range starting at `http://localhost:4100`. Each health service keeps its port no matter which other services run or how many upstream services exist.
39
39
 
40
40
  - **FHIR R4** on `http://localhost:4100` (create, read, update, JSON Patch, delete, versioning, `_history`, search, batch and transaction Bundles, and a CapabilityStatement at `/metadata`, `Patient/$everything`, Bulk Data `$export` with NDJSON output; starts with 5 generated synthetic patients; SMART App Launch with patient and practitioner pickers, an EHR launch simulator, PKCE, SMART Backend Services with `private_key_jwt`, and scope and patient enforcement for presented tokens; terminology fixtures with `CodeSystem/$lookup` and `$validate-code`; browse it at `/_inspector`)
41
+ - **Epic** on `http://localhost:4101` (the FHIR R4 server under Epic's `/api/FHIR/R4` base, OAuth 2.0 at `/oauth2/authorize` and `/oauth2/token` with SMART App Launch and Backend Services, `__epic.dstu2.patient` in token responses, Epic's informational OperationOutcome on empty searches, and Schedules and Slots with `Appointment/$find` and `Appointment/$book`)
42
+ - **openFDA** on `http://localhost:4102` (`/drug/label.json`, `/drug/event.json`, and `/drug/enforcement.json`, `/device/enforcement.json`, `/food/enforcement.json` recalls with the openFDA query language: `search` with fields, phrases, `.exact`, ranges, `AND`/`OR`/`NOT`, plus `sort`, `count`, `limit`, and `skip`; synthetic labels, adverse event reports, and recalls; browse them at `/_inspector`)
43
+ - **RxNav** on `http://localhost:4103` (the RxNorm REST API under `/REST`: `rxcui`, `drugs`, `properties`, `related`, `allrelated`, `ndcs`, `approximateTerm`, `spellingsuggestions`, and `displaynames`, with or without `.json`, over a verified RxNorm subset plus concepts you add; browse it at `/_inspector`)
44
+ - **ClinicalTrials.gov** on `http://localhost:4104` (API v2 under `/api/v2`: `/studies` with `query.*`, `filter.overallStatus`, `filter.ids`, `filter.advanced` `AREA[]` clauses, `sort`, `fields`, `pageSize`, `pageToken`, and `countTotal`, plus `/studies/{nctId}`, `/version`, and `/stats/size`; synthetic studies with `NCT99` ids; browse them at `/_inspector`)
45
+ - **NCBI E-utilities** on `http://localhost:4105` (`/entrez/eutils/einfo`, `esearch` with field tags, `AND`/`OR`/`NOT`, date ranges, paging, and `usehistory`, `esummary`, `efetch` with PubMed XML and abstract text, and `elink` between Gene and PubMed, in JSON or XML; synthetic PubMed articles and a small set of real human genes; browse them at `/_inspector`)
46
+ - **NPPES NPI Registry** on `http://localhost:4106` (`/api/?version=2.1` with `number`, `enumeration_type`, names and organization names with `*` wildcards, `taxonomy_description`, `city`, `state`, `postal_code`, `limit`, and `skip`, and the registry's `Errors` responses; synthetic providers whose NPIs have valid check digits but start with 0, so they never match a real provider; browse them at `/_inspector`)
47
+ - **Benchling** on `http://localhost:4107` (API v2 under `/api/v2` with an API key as the Basic auth username or a client credentials token: DNA and AA sequences with filters, `nextToken` paging, create, update, archive, and registration through `registries/{id}:register-entities` and `tasks`, notebook `entries`, `assay-results` with schemas, `events`, and Svix-signed webhooks; a synthetic tenant; browse it at `/_inspector`)
48
+ - **REDCap** on `http://localhost:4108` (`POST /api/` with a token and `content`: `version`, `project`, `metadata`, `instrument`, `exportFieldNames`, and `record` export with `records`, `fields`, `forms`, `filterLogic`, labels, and flat or EAV output, import with validation against the data dictionary, and delete, in JSON, CSV, or XML; a synthetic project; browse it at `/_inspector`)
41
49
 
42
50
  Stripe webhooks configured with a secret include a `Stripe-Signature` header signed over the timestamp and raw request body.
43
51
 
@@ -42,8 +42,9 @@ SOFTWARE.
42
42
 
43
43
  The emuhealth synthetic data generator in
44
44
  `packages/@emuhealth/fhir-core/src/generator.ts` uses a small number of codes from
45
- the following code systems to make generated records realistic. No full code
46
- system is redistributed.
45
+ the following code systems to make generated records realistic, and the RxNav
46
+ emulator in `packages/@emuhealth/rxnav` serves the same small RxNorm subset. No
47
+ full code system is redistributed.
47
48
 
48
49
  ### LOINC
49
50
 
@@ -60,8 +61,16 @@ Medicine (NLM), National Institutes of Health, Department of Health and Human
60
61
  Services; NLM is not responsible for the product and does not endorse or
61
62
  recommend this or any other product.
62
63
 
63
- ### ICD-10-CM and CVX
64
+ ### ICD-10-CM, ICD-10-PCS, CVX, and CDC Race and Ethnicity
64
65
 
65
- ICD-10-CM codes are published by the National Center for Health Statistics and
66
- CVX codes by the Centers for Disease Control and Prevention. Both are U.S.
67
- government works in the public domain.
66
+ ICD-10-CM codes are published by the National Center for Health Statistics,
67
+ ICD-10-PCS codes by the Centers for Medicare & Medicaid Services, and CVX codes
68
+ and the Race and Ethnicity code set by the Centers for Disease Control and
69
+ Prevention. All are U.S. government works in the public domain.
70
+
71
+ ### NCBI Gene
72
+
73
+ The E-utilities emulator in `packages/@emuhealth/ncbi` includes the ids, symbols,
74
+ names, and chromosomal locations of ten human genes as published by the National
75
+ Center for Biotechnology Information (NCBI), a U.S. government work in the public
76
+ domain. The gene summaries were written for emuhealth.
package/dist/api.d.ts CHANGED
@@ -249,7 +249,7 @@ declare function defineConfig<Definitions extends Record<string, EmulatorDefinit
249
249
  tokens?: EmulateConfig["tokens"];
250
250
  }): typeof config;
251
251
 
252
- declare const HEALTH_SERVICE_NAME_LIST: readonly ["fhir"];
252
+ declare const HEALTH_SERVICE_NAME_LIST: readonly ["fhir", "epic", "openfda", "rxnav", "clinicaltrials", "ncbi", "nppes", "benchling", "redcap"];
253
253
  type HealthServiceName = (typeof HEALTH_SERVICE_NAME_LIST)[number];
254
254
 
255
255
  declare const SERVICE_NAME_LIST: readonly ["vercel", "github", "google", "slack", "apple", "microsoft", "okta", "aws", "resend", "stripe", "mongoatlas", "clerk", "linear", "twilio"];
package/dist/api.js CHANGED
@@ -1942,14 +1942,24 @@ function defineConfig(config) {
1942
1942
  }
1943
1943
 
1944
1944
  // src/registry-health.ts
1945
- var HEALTH_SERVICE_NAME_LIST = ["fhir"];
1945
+ var HEALTH_SERVICE_NAME_LIST = [
1946
+ "fhir",
1947
+ "epic",
1948
+ "openfda",
1949
+ "rxnav",
1950
+ "clinicaltrials",
1951
+ "ncbi",
1952
+ "nppes",
1953
+ "benchling",
1954
+ "redcap"
1955
+ ];
1946
1956
  var HEALTH_SERVICE_NAMES = HEALTH_SERVICE_NAME_LIST;
1947
1957
  var HEALTH_SERVICE_REGISTRY = {
1948
1958
  fhir: {
1949
1959
  label: "FHIR R4 server emulator",
1950
1960
  endpoints: "create, read, vread, update (including create on update), JSON Patch, logical delete, _history, search with includes and chaining, batch and transaction Bundles, CapabilityStatement at /metadata, Patient/$everything, Bulk Data $export, SMART App Launch and Backend Services, ETag and If-Match, generated synthetic patients, terminology $lookup and $validate-code, inspector at /_inspector",
1951
1961
  async load() {
1952
- const mod = await import("./dist-EPYBRSJC.js");
1962
+ const mod = await import("./dist-JJIQYFJ4.js");
1953
1963
  return { plugin: mod.fhirPlugin, seedFromConfig: mod.seedFromConfig };
1954
1964
  },
1955
1965
  defaultFallback() {
@@ -1969,6 +1979,159 @@ var HEALTH_SERVICE_REGISTRY = {
1969
1979
  ]
1970
1980
  }
1971
1981
  }
1982
+ },
1983
+ epic: {
1984
+ label: "Epic FHIR R4 emulator",
1985
+ endpoints: "Epic URL shape (/api/FHIR/R4) over the full FHIR server, OAuth 2.0 at /oauth2/authorize and /oauth2/token with SMART App Launch and Backend Services, __epic.dstu2.patient in token responses, informational OperationOutcome (4101) on empty searches, Schedules and Slots with Appointment/$find and Appointment/$book, generated synthetic patients, inspector at /_inspector",
1986
+ async load() {
1987
+ const mod = await import("./dist-65JH5Z2J.js");
1988
+ return { plugin: mod.epicPlugin, seedFromConfig: mod.seedFromConfig };
1989
+ },
1990
+ defaultFallback() {
1991
+ return { login: "epic-user", id: 1, scopes: [] };
1992
+ },
1993
+ initConfig: {
1994
+ epic: {
1995
+ generate: { patients: 5, seed: 1 },
1996
+ scheduling: { days: 10 },
1997
+ smart: { clients: [{ client_id: "my-epic-app", redirect_uris: ["http://localhost:3000/callback"] }] }
1998
+ }
1999
+ }
2000
+ },
2001
+ openfda: {
2002
+ label: "openFDA API emulator",
2003
+ endpoints: "drug labels (/drug/label.json), adverse event reports (/drug/event.json), and recalls (/drug/enforcement.json, /device/enforcement.json, /food/enforcement.json) with the openFDA query language (search, sort, count, limit, skip), synthetic datasets, inspector at /_inspector",
2004
+ async load() {
2005
+ const mod = await import("./dist-WRDU25DF.js");
2006
+ return { plugin: mod.openfdaPlugin, seedFromConfig: mod.seedFromConfig };
2007
+ },
2008
+ defaultFallback() {
2009
+ return { login: "openfda-user", id: 1, scopes: [] };
2010
+ },
2011
+ initConfig: {
2012
+ openfda: {
2013
+ generate: { seed: 1, events: 300 }
2014
+ }
2015
+ }
2016
+ },
2017
+ rxnav: {
2018
+ label: "NLM RxNav (RxNorm API) emulator",
2019
+ endpoints: "RxNorm REST API under /REST: rxcui by name, drugs, properties, related and allrelated concepts, ndcs, approximateTerm, spellingsuggestions, displaynames, with or without .json; built-in RxNorm subset plus configured concepts; inspector at /_inspector",
2020
+ async load() {
2021
+ const mod = await import("./dist-HUDK42DK.js");
2022
+ return { plugin: mod.rxnavPlugin, seedFromConfig: mod.seedFromConfig };
2023
+ },
2024
+ defaultFallback() {
2025
+ return { login: "rxnav-user", id: 1, scopes: [] };
2026
+ },
2027
+ initConfig: {
2028
+ rxnav: {
2029
+ concepts: [
2030
+ {
2031
+ rxcui: "900001",
2032
+ name: "examplemab",
2033
+ tty: "IN"
2034
+ }
2035
+ ]
2036
+ }
2037
+ }
2038
+ },
2039
+ clinicaltrials: {
2040
+ label: "ClinicalTrials.gov API v2 emulator",
2041
+ endpoints: "ClinicalTrials.gov API v2 under /api/v2: studies search (query.cond, query.term, query.intr, query.titles, query.locn, query.spons, query.id, filter.overallStatus, filter.ids, filter.advanced AREA[], sort, fields, pageSize, pageToken, countTotal), single studies, version, stats/size; synthetic studies in the NCT99 range; inspector at /_inspector",
2042
+ async load() {
2043
+ const mod = await import("./dist-MRCWT2JC.js");
2044
+ return { plugin: mod.clinicaltrialsPlugin, seedFromConfig: mod.seedFromConfig };
2045
+ },
2046
+ defaultFallback() {
2047
+ return { login: "clinicaltrials-user", id: 1, scopes: [] };
2048
+ },
2049
+ initConfig: {
2050
+ clinicaltrials: {
2051
+ generate: {
2052
+ studies: 60,
2053
+ seed: 1
2054
+ }
2055
+ }
2056
+ }
2057
+ },
2058
+ ncbi: {
2059
+ label: "NCBI E-utilities emulator (PubMed and Gene)",
2060
+ endpoints: "E-utilities under /entrez/eutils: einfo, esearch (field tags, AND/OR/NOT, [dp] ranges, retstart/retmax, usehistory WebEnv), esummary, efetch (PubMed XML and abstract text), elink (gene and pubmed), GET or POST, JSON or XML; synthetic PubMed articles and real human genes; inspector at /_inspector",
2061
+ async load() {
2062
+ const mod = await import("./dist-MD4P4BXL.js");
2063
+ return { plugin: mod.ncbiPlugin, seedFromConfig: mod.seedFromConfig };
2064
+ },
2065
+ defaultFallback() {
2066
+ return { login: "ncbi-user", id: 1, scopes: [] };
2067
+ },
2068
+ initConfig: {
2069
+ ncbi: {
2070
+ generate: {
2071
+ articles: 80,
2072
+ seed: 1
2073
+ }
2074
+ }
2075
+ }
2076
+ },
2077
+ nppes: {
2078
+ label: "NPPES NPI Registry API emulator",
2079
+ endpoints: "NPI Registry API at /api/?version=2.1: number, enumeration_type, first_name, last_name, organization_name (trailing * wildcards), taxonomy_description, address_purpose, city, state, postal_code, country_code, limit (max 200), skip; the registry's Errors shapes; synthetic providers with NPIs that start with 0; inspector at /_inspector",
2080
+ async load() {
2081
+ const mod = await import("./dist-WDXPM6L6.js");
2082
+ return { plugin: mod.nppesPlugin, seedFromConfig: mod.seedFromConfig };
2083
+ },
2084
+ defaultFallback() {
2085
+ return { login: "nppes-user", id: 1, scopes: [] };
2086
+ },
2087
+ initConfig: {
2088
+ nppes: {
2089
+ generate: {
2090
+ individuals: 40,
2091
+ organizations: 15,
2092
+ seed: 1
2093
+ }
2094
+ }
2095
+ }
2096
+ },
2097
+ benchling: {
2098
+ label: "Benchling API v2 emulator",
2099
+ endpoints: "Benchling API v2 under /api/v2 with API key (Basic) or client credentials (Bearer) auth: dna-sequences and aa-sequences (list, filter, page, create, update, archive), entries, registries and register-entities with tasks, assay-results and schemas, projects, folders, events, Svix-signed webhooks; synthetic tenant; inspector at /_inspector",
2100
+ async load() {
2101
+ const mod = await import("./dist-JAQBQLBJ.js");
2102
+ return { plugin: mod.benchlingPlugin, seedFromConfig: mod.seedFromConfig };
2103
+ },
2104
+ defaultFallback() {
2105
+ return { login: "benchling-user", id: 1, scopes: [] };
2106
+ },
2107
+ initConfig: {
2108
+ benchling: {
2109
+ generate: {
2110
+ seed: 1,
2111
+ dnaSequences: 10
2112
+ },
2113
+ webhooks: []
2114
+ }
2115
+ }
2116
+ },
2117
+ redcap: {
2118
+ label: "REDCap API emulator",
2119
+ endpoints: "REDCap API at POST /api/ with token and content: version, project, metadata, instrument, exportFieldNames, record export (records, fields, forms, filterLogic, rawOrLabel, flat or eav), record import (json or csv, overwriteBehavior, forceAutoNumber, returnContent), record delete, generateNextRecordName; json, csv, or xml; synthetic classic project; inspector at /_inspector",
2120
+ async load() {
2121
+ const mod = await import("./dist-CLJBPXNS.js");
2122
+ return { plugin: mod.redcapPlugin, seedFromConfig: mod.seedFromConfig };
2123
+ },
2124
+ defaultFallback() {
2125
+ return { login: "redcap-user", id: 1, scopes: [] };
2126
+ },
2127
+ initConfig: {
2128
+ redcap: {
2129
+ generate: {
2130
+ records: 20,
2131
+ seed: 1
2132
+ }
2133
+ }
2134
+ }
1972
2135
  }
1973
2136
  };
1974
2137
  var HEALTH_PORT_OFFSET = 100;