Skip to content

Commit

Permalink
feat: remove RD prefix of rd domains
Browse files Browse the repository at this point in the history
  • Loading branch information
tada5hi committed Jan 3, 2024
1 parent 2befba6 commit 8ca6949
Show file tree
Hide file tree
Showing 22 changed files with 86 additions and 86 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/domains/patient/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type Patient = {
/**
* @see https://github.com/KohlbacherLab/dnpm-dip-service-base/blob/main/src/main/scala/de/dnpm/dip/service/query/PatientMatch.scala
*/
export type PatientMatch<Criteria = any> = {
export type PatientMatchBase<Criteria = any> = {
id: string,
managingSite?: Coding,
gender: Coding<'male' | 'female' | 'other' | 'unknown'>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ import { createResourceRecordManager, defineResourceRecordEvents } from '@dnpm-d
import type { PropType, SlotsType } from 'vue';
import { defineComponent, toRef } from 'vue';
import { useRDAPIClient } from '../../composables';
import type { RDPreparedQuery } from '../../domains';
import type { PreparedQuery } from '../../domains';

export default defineComponent({
props: {
entity: {
type: Object as PropType<RDPreparedQuery>,
type: Object as PropType<PreparedQuery>,
},
entityId: {
type: String,
},
},
emits: defineResourceRecordEvents<RDPreparedQuery>(),
slots: Object as SlotsType<ResourceRecordSlots<RDPreparedQuery>>,
emits: defineResourceRecordEvents<PreparedQuery>(),
slots: Object as SlotsType<ResourceRecordSlots<PreparedQuery>>,
async setup(props, setup) {
const api = useRDAPIClient();
const id = toRef(props, 'entityId');
Expand Down
14 changes: 7 additions & 7 deletions packages/rd/src/runtime/components/core/PreparedQueryForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import {
import SearchForm from './SearchForm.vue';
import PreparedQueryList from './PreparedQueryList';
import PreparedQueryEntity from './PreparedQueryEntity';
import type { QuerySession, RDPreparedQuery, RDQueryCriteria } from '../../domains';
import type { PreparedQuery, QueryCriteria, QuerySession } from '../../domains';
export default defineComponent({
components: { PreparedQueryEntity, PreparedQueryList, SearchForm },
emits: ['submitted'],
setup(props, setup) {
const searchEl = ref(null) as Ref<null | typeof SearchForm>;
const criteria = ref<RDQueryCriteria | undefined>(undefined);
const criteria = ref<QueryCriteria | undefined>(undefined);
const preparedQueryNode = ref(null) as Ref<null | typeof PreparedQueryList>;
const preparedQuery = ref<RDPreparedQuery | undefined>(undefined);
const preparedQuery = ref<PreparedQuery | undefined>(undefined);
const preparedQueryId = computed(() => {
if (preparedQuery.value) {
return preparedQuery.value.id;
Expand All @@ -33,7 +33,7 @@ export default defineComponent({
});
};
const togglePreparedQuery = (data: RDPreparedQuery) => {
const togglePreparedQuery = (data: PreparedQuery) => {
if (
preparedQuery.value &&
preparedQuery.value.id === data.id
Expand Down Expand Up @@ -66,21 +66,21 @@ export default defineComponent({
});
};
const handlePreparedQueryCreated = (data: RDPreparedQuery) => {
const handlePreparedQueryCreated = (data: PreparedQuery) => {
preparedQuery.value = data;
if (preparedQueryNode.value) {
preparedQueryNode.value.created(data);
}
};
const handlePreparedQueryUpdated = (data: RDPreparedQuery) => {
const handlePreparedQueryUpdated = (data: PreparedQuery) => {
preparedQuery.value = data;
if (preparedQueryNode.value) {
preparedQueryNode.value.updated(data);
}
};
const handlePreparedQueryDeleted = (data: RDPreparedQuery) => {
const handlePreparedQueryDeleted = (data: PreparedQuery) => {
if (
preparedQuery.value &&
preparedQuery.value.id === data.id
Expand Down
6 changes: 3 additions & 3 deletions packages/rd/src/runtime/components/core/PreparedQueryList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { createResourceCollectionManager, defineResourceCollectionEvents } from
import type { SlotsType } from 'vue';
import { defineComponent } from 'vue';
import { useRDAPIClient } from '../../composables';
import type { RDPreparedQuery } from '../../domains';
import type { PreparedQuery } from '../../domains';

export default defineComponent({
slots: Object as SlotsType<ResourceCollectionSlots<RDPreparedQuery>>,
emits: defineResourceCollectionEvents<RDPreparedQuery>(),
slots: Object as SlotsType<ResourceCollectionSlots<PreparedQuery>>,
emits: defineResourceCollectionEvents<PreparedQuery>(),
setup(props, setup) {
const api = useRDAPIClient();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script lang="ts">
import type { PropType } from 'vue';
import { defineComponent, ref } from 'vue';
import type { RDPatientMatch } from '../../domains';
import type { PatientMatch } from '../../domains';
export default defineComponent({
props: {
entity: {
type: Object as PropType<RDPatientMatch>,
type: Object as PropType<PatientMatch>,
required: true,
},
queryId: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ObjectLiteral, PatientMatch, ResourceCollectionSlots } from '@dnpm-dip/core';
import type { ObjectLiteral, PatientMatchBase, ResourceCollectionSlots } from '@dnpm-dip/core';
import { createResourceCollectionManager } from '@dnpm-dip/core';
import type { PropType, SlotsType } from 'vue';
import { defineComponent, toRef } from 'vue';
Expand All @@ -14,7 +14,7 @@ export default defineComponent({
type: Object as PropType<ObjectLiteral>,
},
},
slots: Object as SlotsType<ResourceCollectionSlots<PatientMatch>>,
slots: Object as SlotsType<ResourceCollectionSlots<PatientMatchBase>>,
setup(props, setup) {
const api = useRDAPIClient();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
import type { SlotsType } from 'vue';
import { defineComponent, toRef } from 'vue';
import { useRDAPIClient } from '#imports';
import type { RDPatientRecord } from '../../domains';
import type { PatientRecord } from '../../domains';

export default defineComponent({
props: {
Expand All @@ -23,7 +23,7 @@ export default defineComponent({
default: false,
},
},
slots: Object as SlotsType<ResourceRecordSlots<RDPatientRecord>>,
slots: Object as SlotsType<ResourceRecordSlots<PatientRecord>>,
async setup(props, setup) {
const apiClient = useRDAPIClient();
const id = toRef(props, 'queryId');
Expand Down
26 changes: 13 additions & 13 deletions packages/rd/src/runtime/components/core/SearchForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import {
defineComponent, ref,
} from 'vue';
import type {
PreparedQuery,
QueryCriteria,
QueryCriteriaVariant,
QuerySession,
RDPreparedQuery,
RDQueryCriteria,
RDQueryCriteriaVariant,
} from '../../domains';
import { useRDAPIClient } from '#imports';
import VariantFormTabGroup from './VariantFormTabGroup.vue';
Expand All @@ -27,7 +27,7 @@ export default defineComponent({
},
props: {
criteria: {
type: Object as PropType<RDQueryCriteria>,
type: Object as PropType<QueryCriteria>,
},
queryId: {
type: String,
Expand All @@ -36,7 +36,7 @@ export default defineComponent({
type: String as PropType<QueryRequestMode>,
},
preparedQuery: {
type: Object as PropType<RDPreparedQuery>,
type: Object as PropType<PreparedQuery>,
},
preparedQueryId: {
type: String,
Expand All @@ -61,12 +61,12 @@ export default defineComponent({
];
const busy = ref(false);
const criteria = ref<RDQueryCriteria>({});
const criteria = ref<QueryCriteria>({});
const categories = ref<FormSelectOption[]>([]);
const hpoTerms = ref<FormSelectOption[]>([]);
const variants = ref<RDQueryCriteriaVariant<string>[]>([]);
const variants = ref<QueryCriteriaVariant<string>[]>([]);
const preparedQueryId = ref<string | undefined>(undefined);
const preparedQueryName = ref('');
Expand Down Expand Up @@ -122,12 +122,12 @@ export default defineComponent({
if (criteria.value.variants) {
for (let i = 0; i < criteria.value.variants.length; i++) {
const variant = criteria.value.variants[i] as RDQueryCriteriaVariant;
const data : RDQueryCriteriaVariant<string> = {};
const variant = criteria.value.variants[i] as QueryCriteriaVariant;
const data : QueryCriteriaVariant<string> = {};
const keys = Object.keys(variant);
for (let j = 0; j < keys.length; j++) {
data[keys[j] as keyof typeof data] = variant[keys[j] as keyof RDQueryCriteriaVariant]?.code;
data[keys[j] as keyof typeof data] = variant[keys[j] as keyof QueryCriteriaVariant]?.code;
}
variants.value.push(data);
Expand Down Expand Up @@ -180,8 +180,8 @@ export default defineComponent({
}
};
const buildCriteria = () : RDQueryCriteria => {
const payload : RDQueryCriteria = {};
const buildCriteria = () : QueryCriteria => {
const payload : QueryCriteria = {};
if (variants.value.length > 0) {
for (let i = 0; i < variants.value.length; i++) {
const variant = variants.value[i];
Expand Down Expand Up @@ -240,7 +240,7 @@ export default defineComponent({
const payload = buildCriteria();
try {
let preparedQuery : RDPreparedQuery | undefined;
let preparedQuery : PreparedQuery | undefined;
if (preparedQueryId.value) {
preparedQuery = await apiClient.preparedQuery.update(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import {
type PropType, defineComponent, reactive, toRef, watch,
} from 'vue';
import { DCodeSystem, DCollectionTransform, DFormSelectSearch } from '@dnpm-dip/core';
import type { RDQueryCriteriaVariant } from '../../domains';
import type { QueryCriteriaVariant } from '../../domains';
export default defineComponent({
components: { DCollectionTransform, DCodeSystem, DFormSelectSearch },
emit: ['updated'],
props: {
entity: {
type: Object as PropType<RDQueryCriteriaVariant<string>>,
type: Object as PropType<QueryCriteriaVariant<string>>,
},
},
setup(props, { emit }) {
Expand Down
6 changes: 3 additions & 3 deletions packages/rd/src/runtime/domains/case/types.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { Patient } from '@dnpm-dip/core';
import type { RDDiagnosis } from '../diagnosis';
import type { Diagnosis } from '../diagnosis';

/**
* @see https://github.com/KohlbacherLab/dnpm-dip-rd-model/blob/main/dto_model/src/main/scala/de/dnpm/dip/rd/model/RDCase.scala
*/
export type RDCase = {
export type Case = {
id: string,
externalId?: {
value: string,
Expand All @@ -23,5 +23,5 @@ export type RDCase = {
referrer: {
name: string
},
reason: RDDiagnosis
reason: Diagnosis
};
2 changes: 1 addition & 1 deletion packages/rd/src/runtime/domains/diagnosis/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Coding, Patient } from '@dnpm-dip/core';
/**
* @see https://github.com/KohlbacherLab/dnpm-dip-rd-model/blob/main/dto_model/src/main/scala/de/dnpm/dip/rd/model/RDDiagnosis.scala
*/
export type RDDiagnosis = {
export type Diagnosis = {
id: string,
patient: Patient,
recordedOn?: string,
Expand Down
2 changes: 1 addition & 1 deletion packages/rd/src/runtime/domains/ngs-report/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export type Variant = {
/**
* @see https://github.com/KohlbacherLab/dnpm-dip-rd-model/blob/main/dto_model/src/main/scala/de/dnpm/dip/rd/model/RDNGSReport.scala
*/
export type RDNGSReport = {
export type NGSReport = {
id: string,
patient: Patient,
performingLab: {
Expand Down
24 changes: 12 additions & 12 deletions packages/rd/src/runtime/domains/patient/types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Coding, Patient, PatientMatch } from '@dnpm-dip/core';
import type { RDCase } from '../case';
import type { RDDiagnosis } from '../diagnosis';
import type { RDNGSReport } from '../ngs-report';
import type { RDQueryCriteria } from '../query';
import type { RDTherapy } from '../therapy';
import type { Coding, Patient, PatientMatchBase } from '@dnpm-dip/core';
import type { Case } from '../case';
import type { Diagnosis } from '../diagnosis';
import type { NGSReport } from '../ngs-report';
import type { QueryCriteria } from '../query';
import type { Therapy } from '../therapy';

/**
* @see https://github.com/KohlbacherLab/dnpm-dip-rd-model/blob/main/dto_model/src/main/scala/de/dnpm/dip/rd/model/Observations.scala
Expand All @@ -17,13 +17,13 @@ type HPOTerm = {
/**
* @see https://github.com/KohlbacherLab/dnpm-dip-rd-model/blob/main/dto_model/src/main/scala/de/dnpm/dip/rd/model/RDPatientRecord.scala
*/
export type RDPatientRecord = {
case: RDCase,
diagnosis: RDDiagnosis,
export type PatientRecord = {
case: Case,
diagnosis: Diagnosis,
hpoTerms: HPOTerm[],
ngsReports: RDNGSReport[],
ngsReports: NGSReport[],
patient: Patient,
therapy?: RDTherapy
therapy?: Therapy
};

export type RDPatientMatch = PatientMatch<RDQueryCriteria>;
export type PatientMatch = PatientMatchBase<QueryCriteria>;
16 changes: 8 additions & 8 deletions packages/rd/src/runtime/domains/prepared-query/api.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
import type { CollectionResponse, ResourceCollectionLoadResponse } from '@dnpm-dip/core';
import { BaseAPI } from '@dnpm-dip/core';
import type {
RDPreparedQuery,
RDPreparedQueryCreate,
RDPreparedQueryUpdate,
PreparedQuery,
PreparedQueryCreate,
PreparedQueryUpdate,
} from './types';

export class PreparedQueryAPI extends BaseAPI {
async create(data: RDPreparedQueryCreate) : Promise<RDPreparedQuery> {
async create(data: PreparedQueryCreate) : Promise<PreparedQuery> {
const response = await this.client.post('rd/prepared-queries', data);
return response.data;
}

async getOne(id: string) : Promise<RDPreparedQuery> {
async getOne(id: string) : Promise<PreparedQuery> {
const response = await this.client.get(`rd/prepared-queries/${id}`);
return response.data;
}

async getMany() : Promise<CollectionResponse<RDPreparedQuery>> {
async getMany() : Promise<CollectionResponse<PreparedQuery>> {
const response = await this.client.get('rd/prepared-queries');
return response.data;
}

async update(id: string, data: RDPreparedQueryUpdate) : Promise<RDPreparedQuery> {
async update(id: string, data: PreparedQueryUpdate) : Promise<PreparedQuery> {
const response = await this.client.patch(`rd/prepared-queries/${id}`, data);
return response.data;
}

async delete(id: string) : Promise<RDPreparedQuery> {
async delete(id: string) : Promise<PreparedQuery> {
const response = await this.client.delete(`rd/prepared-queries/${id}`);
return response.data;
}
Expand Down
12 changes: 6 additions & 6 deletions packages/rd/src/runtime/domains/prepared-query/types.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import type { RDQueryCriteria } from '../query';
import type { QueryCriteria } from '../query';

export type RDPreparedQueryCreate = {
export type PreparedQueryCreate = {
name?: string,
criteria: RDQueryCriteria
criteria: QueryCriteria
};

export type RDPreparedQueryUpdate = RDPreparedQueryCreate;
export type PreparedQueryUpdate = PreparedQueryCreate;

export type RDPreparedQuery = {
export type PreparedQuery = {
id: string,
name: string,
criteria: RDQueryCriteria
criteria: QueryCriteria
};
Loading

0 comments on commit 8ca6949

Please sign in to comment.