Skip to content

Commit

Permalink
Use fhir-validator as package
Browse files Browse the repository at this point in the history
Ref: #7
  • Loading branch information
projkov committed Sep 6, 2024
1 parent 8f4c5fd commit 90b589f
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 7 deletions.
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"author": "",
"private": true,
"license": "UNLICENSED",
"workspaces": [
"packages/*"
],
"scripts": {
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
Expand All @@ -18,7 +21,8 @@
"test:cov": "jest --testPathIgnorePatterns='/suites/' --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --testPathIgnorePatterns='/suites/' --config ./test/jest-e2e.json",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"prepare": "npm run prepare --workspaces"
},
"dependencies": {
"@medplum/core": "^3.2.4",
Expand All @@ -38,7 +42,8 @@
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.1",
"swagger-ui-express": "^5.0.1",
"typeorm": "^0.3.20"
"typeorm": "^0.3.20",
"@beda.software/fhir-validator": "./"
},
"devDependencies": {
"@nestjs/cli": "^10.0.0",
Expand Down Expand Up @@ -70,7 +75,7 @@
"ts"
],
"testTimeout": 30000,
"rootDir": "src",
"rootDir": "./",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
Expand Down
11 changes: 11 additions & 0 deletions packages/fhir-validator/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@beda.software/fhir-validator",
"version": "0.0.1",
"description": "",
"main": "dist/index.js",
"scripts": {
"prepare": "tsc"
},
"author": "",
"license": "MIT"
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import axios from 'axios';
import { validateResource } from './services';
import { timeout } from 'rxjs';
import { validateResource } from '.';

jest.mock('axios');
const mockedAxios = axios as jest.Mocked<typeof axios>;
Expand Down
22 changes: 22 additions & 0 deletions packages/fhir-validator/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"target": "ES2021",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"incremental": true,
"skipLibCheck": true,
"strictNullChecks": false,
"noImplicitAny": false,
"strictBindCallApply": false,
"forceConsistentCasingInFileNames": false,
"noFallthroughCasesInSwitch": false,
"noEmit": false
}
}
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import 'reflect-metadata';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import { initialValidateResource } from './utils/services';
import { initialValidateResource } from '@beda.software/fhir-validator';

async function bootstrap() {
const app = await NestFactory.create(AppModule, { cors: true });
Expand Down
2 changes: 1 addition & 1 deletion src/suites/1.0.0-ballot/Patient/patients.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
getRequestsWithUnavailableComboSearchParams,
getRequestsWithUnavailableSearchParams,
} from '../../../utils/clientTestingHelpers';
import { isResourceValid } from '../../../utils/services';
import { isResourceValid } from '@beda.software/fhir-validator';
import { Request } from '../../../modules/requests/request.entity';

// function patientRequestsOnlyAvailableInteractionsExists(requests: Request[]): boolean {
Expand Down
23 changes: 23 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,29 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==

"@beda.software/fhir-validator@./":
version "0.0.1"
dependencies:
"@beda.software/fhir-validator" "./"
"@medplum/core" "^3.2.4"
"@nestjs/common" "^10.0.0"
"@nestjs/config" "^3.2.3"
"@nestjs/core" "^10.0.0"
"@nestjs/platform-express" "^10.0.0"
"@nestjs/swagger" "^7.4.0"
"@nestjs/typeorm" "^10.0.2"
"@types/fhir" "^0.0.41"
axios "^1.7.4"
dotenv "^16.4.5"
flatted "^3.3.1"
http-proxy "^1.18.1"
http-proxy-middleware "^3.0.0"
pg "^8.12.0"
reflect-metadata "^0.2.2"
rxjs "^7.8.1"
swagger-ui-express "^5.0.1"
typeorm "^0.3.20"

"@colors/[email protected]":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9"
Expand Down

0 comments on commit 90b589f

Please sign in to comment.