Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Mautsch committed Dec 10, 2023
1 parent 0310845 commit 9228984
Show file tree
Hide file tree
Showing 24 changed files with 49 additions and 49 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.goafabric.core.fhir.r4;

import org.goafabric.core.fhir.r4.controller.vo.Bundle;
import org.goafabric.core.fhir.r4.controller.dto.Bundle;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;
import org.springframework.context.annotation.Configuration;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.goafabric.core.fhir.r4.controller;

import org.goafabric.core.fhir.r4.controller.vo.Bundle;
import org.goafabric.core.fhir.r4.controller.dto.Bundle;

public interface FhirProjector<T> {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.goafabric.core.fhir.r4.controller;

import org.goafabric.core.fhir.r4.controller.vo.MetaData;
import org.goafabric.core.fhir.r4.controller.dto.MetaData;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import org.goafabric.core.organization.logic.OrganizationLogic;
import org.goafabric.core.fhir.r4.logic.mapper.FhirOrganizationMapper;
import org.goafabric.core.fhir.r4.controller.vo.Bundle;
import org.goafabric.core.fhir.r4.controller.vo.Organization;
import org.goafabric.core.fhir.r4.controller.dto.Bundle;
import org.goafabric.core.fhir.r4.controller.dto.Organization;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import org.goafabric.core.organization.logic.PatientLogic;
import org.goafabric.core.fhir.r4.logic.mapper.FhirPatientMapper;
import org.goafabric.core.fhir.r4.controller.vo.Bundle;
import org.goafabric.core.fhir.r4.controller.vo.Patient;
import org.goafabric.core.fhir.r4.controller.dto.Bundle;
import org.goafabric.core.fhir.r4.controller.dto.Patient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import org.goafabric.core.organization.logic.PractitionerLogic;
import org.goafabric.core.fhir.r4.logic.mapper.FhirPractitionerMapper;
import org.goafabric.core.fhir.r4.controller.vo.Bundle;
import org.goafabric.core.fhir.r4.controller.vo.Practitioner;
import org.goafabric.core.fhir.r4.controller.dto.Bundle;
import org.goafabric.core.fhir.r4.controller.dto.Practitioner;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package org.goafabric.core.fhir.r4.controller.vo;
package org.goafabric.core.fhir.r4.controller.dto;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.goafabric.core.fhir.r4.controller.vo;
package org.goafabric.core.fhir.r4.controller.dto;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package org.goafabric.core.fhir.r4.controller.vo;
package org.goafabric.core.fhir.r4.controller.dto;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package org.goafabric.core.fhir.r4.controller.vo;
package org.goafabric.core.fhir.r4.controller.dto;
public record Meta (
String versionId,
String lastUpdated,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package org.goafabric.core.fhir.r4.controller.vo;
package org.goafabric.core.fhir.r4.controller.dto;

public record MetaData (
String resourceType,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

package org.goafabric.core.fhir.r4.controller.vo;
package org.goafabric.core.fhir.r4.controller.dto;

import org.goafabric.core.fhir.r4.controller.vo.identifier.Identifier;
import org.goafabric.core.fhir.r4.controller.dto.identifier.Identifier;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

package org.goafabric.core.fhir.r4.controller.vo;
package org.goafabric.core.fhir.r4.controller.dto;

import org.goafabric.core.fhir.r4.controller.vo.identifier.Identifier;
import org.goafabric.core.fhir.r4.controller.dto.identifier.Identifier;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

package org.goafabric.core.fhir.r4.controller.vo;
package org.goafabric.core.fhir.r4.controller.dto;

import org.goafabric.core.fhir.r4.controller.vo.identifier.Identifier;
import org.goafabric.core.fhir.r4.controller.dto.identifier.Identifier;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package org.goafabric.core.fhir.r4.controller.vo;
package org.goafabric.core.fhir.r4.controller.dto;

public record Telecom (
String id,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.goafabric.core.fhir.r4.controller.dto.identifier;

public record Coding(String code, String system)
{}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package org.goafabric.core.fhir.r4.controller.vo.identifier;
package org.goafabric.core.fhir.r4.controller.dto.identifier;

public record Identifier (
IdentifierUse use,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.goafabric.core.fhir.r4.controller.vo.identifier;
package org.goafabric.core.fhir.r4.controller.dto.identifier;

public enum IdentifierUse {
official("official");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.goafabric.core.fhir.r4.controller.vo.identifier;
package org.goafabric.core.fhir.r4.controller.dto.identifier;

import java.util.List;

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

public interface FhirBaseMapper {
@Mapping(expression = "java(value.getStreet())", target = "street")
org.goafabric.core.organization.controller.dto.Address map(org.goafabric.core.fhir.r4.controller.vo.Address value);
org.goafabric.core.organization.controller.dto.Address map(org.goafabric.core.fhir.r4.controller.dto.Address value);

@Mapping(expression = "java(java.util.Collections.singletonList(value.street()))", target = "line")
org.goafabric.core.fhir.r4.controller.vo.Address map(org.goafabric.core.organization.controller.dto.Address value);
org.goafabric.core.fhir.r4.controller.dto.Address map(org.goafabric.core.organization.controller.dto.Address value);
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.goafabric.core.fhir.r4.logic.mapper;

import org.goafabric.core.fhir.r4.controller.vo.identifier.Coding;
import org.goafabric.core.fhir.r4.controller.vo.identifier.Identifier;
import org.goafabric.core.fhir.r4.controller.vo.identifier.IdentifierUse;
import org.goafabric.core.fhir.r4.controller.vo.identifier.Type;
import org.goafabric.core.fhir.r4.controller.dto.identifier.Coding;
import org.goafabric.core.fhir.r4.controller.dto.identifier.Identifier;
import org.goafabric.core.fhir.r4.controller.dto.identifier.IdentifierUse;
import org.goafabric.core.fhir.r4.controller.dto.identifier.Type;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
Expand All @@ -15,14 +15,14 @@
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface FhirOrganizationMapper extends FhirBaseMapper{
@Mapping(source = "telecom", target = "contactPoint")
org.goafabric.core.organization.controller.dto.Organization map(org.goafabric.core.fhir.r4.controller.vo.Organization value);
org.goafabric.core.organization.controller.dto.Organization map(org.goafabric.core.fhir.r4.controller.dto.Organization value);

@Mapping(source = "contactPoint", target = "telecom")
@Mapping(expression = "java(mapLanr(value))", target = "identifier")
org.goafabric.core.fhir.r4.controller.vo.Organization map(org.goafabric.core.organization.controller.dto.Organization value);
org.goafabric.core.fhir.r4.controller.dto.Organization map(org.goafabric.core.organization.controller.dto.Organization value);

@Mapping(source = "contactPoint", target = "telecom")
List<org.goafabric.core.fhir.r4.controller.vo.Organization> map(List<org.goafabric.core.organization.controller.dto.Organization> value);
List<org.goafabric.core.fhir.r4.controller.dto.Organization> map(List<org.goafabric.core.organization.controller.dto.Organization> value);

default List<Identifier> mapLanr(org.goafabric.core.organization.controller.dto.Organization value) {
return Collections.singletonList(new Identifier(IdentifierUse.official,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.goafabric.core.fhir.r4.logic.mapper;

import org.goafabric.core.fhir.r4.controller.vo.HumanName;
import org.goafabric.core.fhir.r4.controller.dto.HumanName;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
Expand All @@ -12,15 +12,15 @@
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface FhirPatientMapper extends FhirBaseMapper {
@Mapping(source = "telecom", target = "contactPoint")
org.goafabric.core.organization.controller.dto.Patient map(org.goafabric.core.fhir.r4.controller.vo.Patient value);
org.goafabric.core.organization.controller.dto.Patient map(org.goafabric.core.fhir.r4.controller.dto.Patient value);

@Mapping(source = "contactPoint", target = "telecom")
@Mapping(expression = "java(mapHumanName(value))", target = "name")
//@Mapping(expression = "java(Collections.singletonList(value.address.street))", target = "address.line")
org.goafabric.core.fhir.r4.controller.vo.Patient map(org.goafabric.core.organization.controller.dto.Patient value);
org.goafabric.core.fhir.r4.controller.dto.Patient map(org.goafabric.core.organization.controller.dto.Patient value);

@Mapping(source = "contactPoint", target = "telecom")
List<org.goafabric.core.fhir.r4.controller.vo.Patient> map(List<org.goafabric.core.organization.controller.dto.Patient> value);
List<org.goafabric.core.fhir.r4.controller.dto.Patient> map(List<org.goafabric.core.organization.controller.dto.Patient> value);

default List<HumanName> mapHumanName(org.goafabric.core.organization.controller.dto.Patient value) {
return Collections.singletonList(new HumanName("", value.familyName(), Collections.singletonList(value.givenName())));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.goafabric.core.fhir.r4.logic.mapper;

import org.goafabric.core.fhir.r4.controller.vo.HumanName;
import org.goafabric.core.fhir.r4.controller.vo.identifier.Coding;
import org.goafabric.core.fhir.r4.controller.vo.identifier.Identifier;
import org.goafabric.core.fhir.r4.controller.vo.identifier.IdentifierUse;
import org.goafabric.core.fhir.r4.controller.vo.identifier.Type;
import org.goafabric.core.fhir.r4.controller.dto.HumanName;
import org.goafabric.core.fhir.r4.controller.dto.identifier.Coding;
import org.goafabric.core.fhir.r4.controller.dto.identifier.Identifier;
import org.goafabric.core.fhir.r4.controller.dto.identifier.IdentifierUse;
import org.goafabric.core.fhir.r4.controller.dto.identifier.Type;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
Expand All @@ -16,15 +16,15 @@
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface FhirPractitionerMapper extends FhirBaseMapper {
@Mapping(source = "telecom", target = "contactPoint")
org.goafabric.core.organization.controller.dto.Practitioner map(org.goafabric.core.fhir.r4.controller.vo.Practitioner value);
org.goafabric.core.organization.controller.dto.Practitioner map(org.goafabric.core.fhir.r4.controller.dto.Practitioner value);

@Mapping(source = "contactPoint", target = "telecom")
@Mapping(expression = "java(mapHumanName(value))", target = "name")
@Mapping(expression = "java(mapLanr(value))", target = "identifier")
org.goafabric.core.fhir.r4.controller.vo.Practitioner map(org.goafabric.core.organization.controller.dto.Practitioner value);
org.goafabric.core.fhir.r4.controller.dto.Practitioner map(org.goafabric.core.organization.controller.dto.Practitioner value);

@Mapping(source = "contactPoint", target = "telecom")
List<org.goafabric.core.fhir.r4.controller.vo.Practitioner> map(List<org.goafabric.core.organization.controller.dto.Practitioner> value);
List<org.goafabric.core.fhir.r4.controller.dto.Practitioner> map(List<org.goafabric.core.organization.controller.dto.Practitioner> value);

default List<HumanName> mapHumanName(org.goafabric.core.organization.controller.dto.Practitioner value) {
return Collections.singletonList(new HumanName("", value.familyName(), Collections.singletonList(value.givenName())));
Expand Down

0 comments on commit 9228984

Please sign in to comment.