Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
Added cbo project skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
yuflyud committed Oct 8, 2021
1 parent 72a914e commit 962f9ad
Show file tree
Hide file tree
Showing 10 changed files with 308 additions and 0 deletions.
167 changes: 167 additions & 0 deletions cbo/app/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.hl7.gravity.refimpl.sdohexchange.cbo</groupId>
<artifactId>cbo</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>app</artifactId>
<name>CBO App</name>
<packaging>jar</packaging>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring_boot_version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-r4</artifactId>
<version>${hapi_version}</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-client</artifactId>
<version>${hapi_version}</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-validation-resources-r4</artifactId>
<version>${hapi_version}</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-utilities</artifactId>
<version>3.8.0</version>
</dependency>
<dependency>
<groupId>org.hl7.gravity.refimpl.sdohexchange.components</groupId>
<artifactId>fhir-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.hl7.gravity.refimpl.sdohexchange.components</groupId>
<artifactId>spring-boot-starter-exception-handler</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.12</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-validation</artifactId>
<version>${hapi_version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring_boot_version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>Copy index.html</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>src/main/resources/public</outputDirectory>
<overwrite>true</overwrite>
<resources>
<resource>
<directory>${project.parent.basedir}/ui/dist</directory>
<includes>
<include>index.html</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>Copy Vue.js frontend content</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>src/main/resources/static</outputDirectory>
<overwrite>true</overwrite>
<resources>
<resource>
<directory>${project.parent.basedir}/ui/dist</directory>
<includes>
<include>favicon.*</include>
<include>fonts/</include>
<include>js/</include>
<include>img/</include>
<include>css/</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.hl7.gravity.refimpl.sdohexchange;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class CBOApplication {

public static void main(String[] args) {
SpringApplication.run(CBOApplication.class, args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.hl7.gravity.refimpl.sdohexchange.config;

import ca.uhn.fhir.context.FhirContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FhirConfig {

@Bean
public FhirContext fhirContext() {
return FhirContext.forR4();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package org.hl7.gravity.refimpl.sdohexchange.config;

import com.google.common.collect.Sets;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

@Configuration
public class SpringFoxConfig {

@Bean
public Docket api(ApiInfo apiInfo) {
return new Docket(DocumentationType.SWAGGER_2).consumes(Sets.newHashSet(MediaType.APPLICATION_JSON_VALUE))
.produces(Sets.newHashSet(MediaType.APPLICATION_JSON_VALUE))
.select()
.apis(RequestHandlerSelectors.basePackage("org.hl7.gravity.refimpl.sdohexchange"))
.paths(PathSelectors.any())
.build()
.apiInfo(apiInfo)
.useDefaultResponseMessages(false);
}

@Bean
public ApiInfo apiInfo(@Value("${swagger.title}") String title, Contact contact) {
return new ApiInfoBuilder().title(title)
.contact(contact)
.build();
}

@Bean
public Contact swaggerContact(@Value("${swagger.contact.name}") String name,
@Value("${swagger.contact.url}") String url) {
return new Contact(name, url, null);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.hl7.gravity.refimpl.sdohexchange.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.hl7.gravity.refimpl.sdohexchange.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import springfox.documentation.annotations.ApiIgnore;

@Controller
@ApiIgnore
public class LaunchController {

@GetMapping("/")
public String index() {
return "index.html";
}
}
23 changes: 23 additions & 0 deletions cbo/app/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
spring:
h2:
console:
enabled: true
path: /h2
settings:
web-allow-others: false
datasource:
#url: jdbc:h2:mem:cbodb
#This will crete database files in the RI root /data folder
url: jdbc:h2:file:./data/cbodb
username: sa
password:
driverClassName: org.h2.Driver

swagger:
title: SDOH Exchange CBO App API
contact:
name: Gravity Project
url: https://www.hl7.org/gravity/

server:
port: 8084
4 changes: 4 additions & 0 deletions cbo/app/src/main/resources/messages.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException.detail=#{ex.getMessage()}
ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException.status=404
ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException.title=Not Found
ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException.type=http://httpstatus.es/404
22 changes: 22 additions & 0 deletions cbo/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.hl7.gravity.refimpl.sdohexchange</groupId>
<artifactId>sdoh-exchange</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<groupId>org.hl7.gravity.refimpl.sdohexchange.cbo</groupId>
<artifactId>cbo</artifactId>
<name>CBO</name>
<description>Non-FHIR-Enabled CBO App RI.</description>
<packaging>pom</packaging>

<modules>
<module>ui</module>
<module>app</module>
</modules>
</project>
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<module>components</module>
<module>ehr</module>
<module>cp</module>
<module>cbo</module>
</modules>

</project>

0 comments on commit 962f9ad

Please sign in to comment.