Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"@atomic-ehr/fhirschema": "^0.0.8",
"mustache": "^4.2.0",
"picocolors": "^1.1.1",
"tinyglobby": "^0.2.15",
"yaml": "^2.8.2",
"yargs": "^18.0.0"
},
Expand Down
6 changes: 0 additions & 6 deletions src/api/writer-generator/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type { TypeSchema } from "@root/typeschema";

export const words = (s: string) => {
return s.split(/(?<=[a-z])(?=[A-Z])|[-_.\s]/).filter(Boolean);
};
Expand Down Expand Up @@ -63,7 +61,3 @@ export function deepEqual<T>(obj1: T, obj2: T): boolean {

return keys1.every((key) => keys2.includes(key) && deepEqual(obj1[key], obj2[key]));
}

export const typeSchemaInfo = (schema: TypeSchema): string => {
return `<${schema.identifier.url}> from ${schema.identifier.package}#${schema.identifier.version}`;
};
9 changes: 0 additions & 9 deletions src/cli/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ import yargs from "yargs";
import { hideBin } from "yargs/helpers";
import { typeschemaCommand } from "./typeschema";

/**
* CLI arguments interface
*/
export interface CLIArgv {
verbose?: boolean;
debug?: boolean;
logLevel?: LogLevel;
}

let cliLogger = mkLogger({ prefix: "cli" });

async function setupLoggingMiddleware(argv: any) {
Expand Down
20 changes: 0 additions & 20 deletions src/typeschema/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
*/

import { createHash } from "node:crypto";
import type { CanonicalManager } from "@atomic-ehr/fhir-canonical-manager";
import type * as FS from "@atomic-ehr/fhirschema";
import type { StructureDefinition, ValueSet, ValueSetCompose } from "@root/fhir-types/hl7-fhir-r4-core";
import type { CodegenLog } from "@root/utils/log";

export type Name = string & { readonly __brand: unique symbol };
export type CanonicalUrl = string & { readonly __brand: unique symbol };
Expand Down Expand Up @@ -47,16 +45,6 @@ export const packageMeta = (schema: TypeSchema): PackageMeta => {
};
export const packageMetaToFhir = (packageMeta: PackageMeta) => `${packageMeta.name}#${packageMeta.version}`;
export const packageMetaToNpm = (packageMeta: PackageMeta) => `${packageMeta.name}@${packageMeta.version}`;
export const fhirToPackageMeta = (fhir: string) => {
const [name, version] = fhir.split("#");
if (!name) throw new Error(`Invalid FHIR package meta: ${fhir}`);
return { name, version: version ?? "latest" };
};
export const npmToPackageMeta = (fhir: string) => {
const [name, version] = fhir.split("@");
if (!name) throw new Error(`Invalid FHIR package meta: ${fhir}`);
return { name, version: version ?? "latest" };
};

export const hashSchema = (schema: TypeSchema): string => {
const json = JSON.stringify(schema);
Expand Down Expand Up @@ -426,11 +414,3 @@ export const enrichValueSet = (vs: ValueSet, packageMeta: PackageMeta): RichValu
};

///////////////////////////////////////////////////////////

export interface TypeschemaGeneratorOptions {
logger?: CodegenLog;
treeshake?: string[];
manager: ReturnType<typeof CanonicalManager>;
/** Custom FHIR package registry URL */
registry?: string;
}
Loading