Support
GitHub Issues are not used to manage issues for this repository. Please report any issues you may have on the ETT Google Group. Our technical team will address all questions there. Thank you.
The Scorecard API is a POST RESTful service which takes a C-CDA document as input and returns JSON results
Below is an example Java Snippet to access the Scorecard service in your own applications.
public Void ccdascorecardservice(MultipartFile ccdaFile)
{
LinkedMultiValueMap<String, Object> requestMap = new LinkedMultiValueMap<String, Object>();
String response = "";
try{
File tempFile = File.createTempFile("ccda", "File");
FileOutputStream out = new FileOutputStream(tempFile);
IOUtils.copy(ccdaFile.getInputStream(), out);
requestMap.add("ccdaFile", new FileSystemResource(tempFile));
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
HttpEntity<LinkedMultiValueMap<String, Object>> requestEntity =
new HttpEntity<LinkedMultiValueMap<String, Object>>(requestMap, headers);
RestTemplate restTemplate = new RestTemplate();
FormHttpMessageConverter formConverter = new FormHttpMessageConverter();
formConverter.setCharset(Charset.forName("UTF8"));
restTemplate.getMessageConverters().add(formConverter);
restTemplate.getMessageConverters().add(new MappingJackson2HttpMessageConverter());
response = restTemplate.postForObject("https://ccda.healthit.gov/scorecard/ccdascorecardservice2",
requestEntity, String.class);
tempFile.delete();
}catch(Exception exc)
{
exc.printStackTrace();
}
}
CREATE SEQUENCE public.scorecard_statistics_id_seq
INCREMENT 1
START 83
MINVALUE 1
MAXVALUE 2147483647
CACHE 1;
ALTER SEQUENCE public.scorecard_statistics_id_seq
OWNER TO scorecarduser;
CREATE TABLE public.scorecard_statistics
( id integer NOT NULL DEFAULT nextval('scorecard_statistics_id_seq'::regclass), doctype character varying(100) COLLATE pg_catalog."default", docscore smallint NOT NULL, patientscore smallint NOT NULL, allergiessectionscore smallint NOT NULL, encounterssectionscore smallint NOT NULL, immunizationssectionscore smallint NOT NULL, medicationssectionscore smallint NOT NULL, problemssectionscore smallint NOT NULL, proceduressectionscore smallint NOT NULL, socialhistorysectionscore smallint NOT NULL, vitalssectionscore smallint NOT NULL, resultssectionscore smallint NOT NULL, miscscore smallint NOT NULL, docname character varying(500) COLLATE pg_catalog."default", createtimestamp timestamp without time zone DEFAULT now(), oneclickscorecard boolean NOT NULL DEFAULT false, patientissues smallint, allergiessectionissues smallint, encounterssectionissues smallint, immunizationssectionissues smallint, medicationssectionissues smallint, problemssectionissues smallint, proceduressectionissues smallint, socialhistorysectionissues smallint, vitalssectionissues smallint, resultssectionissues smallint, miscissues smallint, ccdadocumenttype character varying(100) COLLATE pg_catalog."default", directemailaddress character varying(100) COLLATE pg_catalog."default", CONSTRAINT scorecard_statistics_pkey PRIMARY KEY (id) )
WITH ( OIDS = FALSE )
TABLESPACE pg_default; ALTER TABLE public.scorecard_statistics OWNER to scorecarduser;
<span id="tomcat"></span>
* Tomcat
* Inside the latest version of Tomcat, add the following snippet under the GlobalNamingResources tag in server.xml
```XML
<Resource auth="Container"
driverClassName="org.postgresql.Driver"
maxActive="100"
maxIdle="30"
maxWait="10000"
name="jdbc/site_scorecard"
password="scorecarduser"
type="javax.sql.DataSource"
url="jdbc:postgresql://localhost/site_scorecard"
username="scorecarduser"/>
<ResourceLink global="jdbc/site_scorecard"
name="jdbc/site_scorecard"
type="javax.sql.DataSource">
</ResourceLink>
Note: If building the WAR yourself vs using an appropriate local WAR from the releases page, you have the option to skip configuration via scorecard.xml. Otherwise, if using a pre-built WAR, you will need to configure with scorecard.xml as described next
Continued instructions for using a pre-built release WAR:
Download scorecard.xml from https://github.com/onc-healthit/ccda-scorecard/blob/master/src/main/resources/scorecard.xml.
Update parameter values accordingly.
Place a copy of scorecard.xml in $CATALINA_BASE/conf/[enginename]/[hostname]/. For example, ~/apache-tomcat-7.0.57/conf/Catalina/localhost
Copy the WAR file to the Apache Tomcat webapps folder
Start Tomcat
Below is an example of the scorecard.xml configuration which uses local referenceccdaservice URLs. We have used default port (8080) as reference. It can be changed to any port
<Context reloadable="true">
<Parameter name="scorecard.igConformanceCall" value="true" override="true"/>
<Parameter name="scorecard.certificatinResultsCall" value="true" override="true"/>
<Parameter name="scorecard.igConformanceUrl" value="http://localhost:8080/referenceccdaservice/" override="true"/>
<Parameter name="scorecard.certificationResultsUrl" value="http://localhost:8080/referenceccdaservice/" override="true"/>
<Parameter name="scorecard.configFile" value="//path to scorecardConfig.xml" override="true"/>
</Context>
Below is an example of the scorecard.xml configuration which uses CURES production referenceccdaservice URLs
<Context reloadable="true">
<Parameter name="scorecard.igConformanceCall" value="true" override="true"/>
<Parameter name="scorecard.certificatinResultsCall" value="true" override="true"/>
<Parameter name="scorecard.igConformanceUrl" value="https://ccda.healthit.gov/referenceccdaservice/" override="true"/>
<Parameter name="scorecard.certificationResultsUrl" value="https://ccda.healthit.gov/referenceccdaservice/" override="true"/>
<Parameter name="scorecard.configFile" value="//path to scorecardConfig.xml" override="true"/>
</Context>
Note: If using production, you will want to download the public cert from SITE and install it
Deploy the WAR file to Tomcat and start Tomcat. You should be able to see the Scorecard UI by navigating to this URL: http://localhost:8080/scorecard/
Continued instructions if building the WAR yourself:
Navigate to ApplicationConfiguration.java and set OVERRIDE_SCORECARD_XML_CONFIG to true
/**
* True allows setting default scorecard.xml values externally
*/
public static final boolean OVERRIDE_SCORECARD_XML_CONFIG = true;
Decide which server you would like the service to contact for Reference C-CDA Validation. Whether it be a development server, production server, or a custom (such as local) specified server. One can also control the server of the Scorecard itself if desired. These outcomes are based on the Environment set
/**
* Sets the environment for deployment - only relevant if OVERRIDE_SCORECARD_XML_CONFIG is true
* Options are defined in org.sitenv.service.ccda.smartscorecard.configuration.ApplicationConfiguration.Environment
*/
public static final Environment ENV = Environment.ENTER_DESIRED_ENVIRONMENT_FROM_ENUM_HERE;
To use the production servers, set set ENV to Environment.PROD, and skip to final "Build the Scorecard project and deploy the WAR file" step
public static final Environment ENV = Environment.PROD;
For example, to use the development servers, set ENV to Environment.DEV, and "Build the Scorecard project and deploy the WAR file" step
public static final Environment ENV = Environment.DEV;
To use a local or custom server, set ENV to Environment.LOCAL_OR_CUSTOM, and continue through the remaining instructions
public static final Environment ENV = Environment.LOCAL_OR_CUSTOM;
public static final String DEFAULT_LOCAL_SCORECARD_SERVER_URL = "http://localhost:XXXX",
public static final String DEFAULT_LOCAL_REF_VAL_SERVER_URL = "http://localhost:XXXX",
Build the Scorecard project and deploy the WAR file to Tomcat and start Tomcat. You should be able to see the Scorecard UI by navigating to this URL: http://localhost:8000/scorecard/
mvn clean install -D skipTests
keytool -importcert -file $CERT -alias $ALIAS -keystore cacerts -storepass changeit