Giter Club home page Giter Club logo

hapi-fhir's Introduction

HAPI FHIR

HAPI FHIR - Java API for HL7 FHIR Clients and Servers

License

CI/CD

CI Status (master) SNAPSHOT Pipeline Current Release
Build Status Build Status Release Artifacts

Coverage and Quality

codecov Language grade: Java

Documentation and wiki

Complete project documentation is available here: http://hapifhir.io

A demonstration of this project is available here: http://hapi.fhir.org/

This project is Open Source, licensed under the Apache Software License 2.0.

Please see this wiki page for information on where to get help with HAPI FHIR.

Please see Smile CDR for information on commercial support.

hapi-fhir's People

Contributors

anthonys123 avatar bdenton avatar dependabot[bot] avatar dmuylwyk avatar epeartree avatar fil512 avatar frankjtao avatar ianmmarshall avatar infiniteloop90 avatar jamesagnew avatar jasonroberts-smile avatar jkiddo avatar jmarchionatto avatar katiesmilecdr avatar kevindougan-smilecdr avatar lmds avatar longma1 avatar lukedegruchy avatar markiantorno avatar michaelabuckley avatar nathandoef avatar nvg-smile avatar okkokauh avatar patrick-werner avatar petervanhoute avatar sriviere avatar stevenxli avatar tadgh avatar tipzcm avatar tynergjs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hapi-fhir's Issues

A problem with processing search parameters with similar paths

I made a search method for a resource provider with the following signature:

@Search
public List (Location) searchByName(
@OptionalParam(name="partof") ReferenceParam thePartOfId,
@OptionalParam(name="partof.name") StringParam thePartOfName,
) {

When calling the method from my annotation client and passing in values for both parameters i got the following exception:

HTTP 400 Bad Request: Multiple values detected for non-repeatable parameter 'partof'. This server is not configured to allow multiple (AND/OR) values for this param.

That's not such a big deal because my intention is to have the caller use only one of the parameters but not both. Although, when calling the method with only the second parameter supplied (i.e. "partof.name") the server mapped the value to the first parameter. Thus in the resource provider object the "partof" parameter was populated with the value that should have been mapped to the "partof.name" parameter.

As workaround I'm going to try using a parameter name of "_partof.name" instead. I have a feeling that should work but it's not the preferred approach.

XML encoding problem of some resources

After encoding a resource, resource' properties are modified. It seems that BaseParser.java works not correctly. If the same resource is encoded again, the created xml is not the same for some resources, like Composition.

Here could be the beginning of the problem:
public void containResourcesForEncoding(IResource theResource) {
containResourcesForEncoding(theResource, theResource);
}

patient update bug

I create a patient resource successfully: http://fhirtest.uhn.ca/base/Patient/1658

<Patient xmlns="http://hl7.org/fhir">
    <text>
      <status value="generated"/>
      <div xmlns="http://www.w3.org/1999/xhtml">Zimmerman, Mr Brian,</div>
    </text>
    <identifier>
      <use value="usual"/>
      <label value="URNo"/>
      <value value="89532"/>
    </identifier>
    <name>
      <text value="王海生"/>
      <family value="王"/>
      <given value="海生"/>
    </name>
    <telecom>
      <system value="phone"/>
      <value value="9899 9878"/>
      <use value="home"/>
    </telecom>
    <telecom>
      <system value="email"/>
      <value value="[email protected]"/>
      <use value="home"/>
    </telecom>
    <gender>
      <coding>
        <system value="http://hl7.org/fhir/v3/AdministrativeGender"/>
        <code value="M"/>
        <display value="Male"/>
      </coding>
      <text value="Male"/>
    </gender>
    <birthDate value="1986-07-10"/>
    <address id="1c1f583f220d4c06984909210ba9e6ed">
      <use value="home"/>
      <text value="99 Houston Road, BENTLEIGH, 3204"/>
      <line value="99 Houston Road"/>
      <city value="BENTLEIGH"/>
      <state value="Victoria"/>
      <zip value="3204"/>
      <period>
        <start value="2006-06-17"/>
      </period>
    </address>
    <active value="true"/>
</Patient>

then I want to update this one with the following :PUT http://fhirtest.uhn.ca/base/Patient/1658

<Patient xmlns="http://hl7.org/fhir">
    <text>
      <status value="generated"/>
      <div xmlns="http://www.w3.org/1999/xhtml">Zimmerman, Mr Brian,</div>
    </text>
    <identifier>
      <use value="usual"/>
      <label value="URNo"/>
      <value value="89532"/>
    </identifier>
    <name>
      <text value="王海生"/>
      <family value="王"/>
      <given value="海生"/>
    </name>
    <telecom>
      <system value="phone"/>
      <value value="9899 9878"/>
      <use value="home"/>
    </telecom>
    <telecom>
      <system value="email"/>
      <value value="[email protected]"/>
      <use value="home"/>
    </telecom>
    <gender>
      <coding>
        <system value="http://hl7.org/fhir/v3/AdministrativeGender"/>
        <code value="M"/>
        <display value="Male"/>
      </coding>
      <text value="Male"/>
    </gender>
    <birthDate value="1986-07-10"/>
    <address id="1c1f583f220d4c06984909210ba9e6ed">
      <use value="home"/>
      <text value="99 Houston Road, BENTLEIGH, 3204"/>
      <line value="99 Houston Road"/>
      <city value="BENTLEIGH"/>
      <state value="Victoria"/>
      <zip value="3204"/>
      <period>
        <start value="2006-06-16"/>
      </period>
    </address>
    <active value="true"/>
</Patient>

Then I get the following info:

    Status Code: 204 No Content
    Access-Control-Allow-Origin: *
    Connection: close
    Content-Length: 0
    Content-Type: text/plain; charset=UTF-8
    Date: Tue, 05 Aug 2014 08:57:04 GMT
    Location: http://fhirtest.uhn.ca/base/Patient/1658/_history/6
    Server: GlassFish Server Open Source Edition 4.0
    X-Powered-By: HAPI FHIR 0.5-SNAPSHOT RESTful Server
    access-control-allow-methods: GET, POST, PUT, DELETE
    access-control-expose-headers: Content-Location

Organization resource update operation bug

first make a search
GET http://fhirtest.uhn.ca/base/Organization/1665 with 404 not found
then PUT http://fhirtest.uhn.ca/base/Organization/1665

<Organization xmlns="http://hl7.org/fhir">
   <extension url="http://fhir.connectinggta.ca/Profile/organization#providerIdPool">
      <valueUri value="urn:oid:2.16.840.1.113883.3.239.23.21.1"/>
   </extension>
   <text>
      <status value="generated"/>
      <div xmlns="http://www.w3.org/1999/xhtml"/>
   </text>
   <identifier>
      <use value="official"/>
      <label value="HSP 2.16.840.1.113883.3.239.23.21"/>
      <system value="urn:cgta:hsp_ids"/>
      <value value="urn:oid:2.16.840.1.113883.3.239.23.21"/>
   </identifier>
   <name value="火星第五人民医院"/>
</Organization>

It should be



    Status Code: 201 Created
    Connection: close
    Content-Encoding: gzip
    Content-Length: 1846
    Content-Location: http://fhir.healthintersections.com.au/open/Organization/1665/_history/1
    Content-Type: text/html; charset=UTF-8
    Date: Wed, 06 Aug 2014 07:33:40 GMT
    Expires: Tue, 05 Aug 2014 07:33:40 GMT
    Location: http://fhir.healthintersections.com.au/open/Organization/1665/_history/1
    Server: Health Intersections FHIR Server
    access-control-allow-methods: GET, POST, PUT, DELETE
    access-control-allow-origin: *
    access-control-expose-headers: Content-Location

but right now it is

    Status Code: 404 Not Found
    Connection: close
    Content-Length: 39
    Content-Type: text/plain;charset=ISO-8859-1
    Date: Wed, 06 Aug 2014 07:24:14 GMT
    Server: GlassFish Server Open Source Edition 4.0
    X-Powered-By: HAPI FHIR 0.6-SNAPSHOT RESTful Server
    access-control-allow-methods: GET, POST, PUT, DELETE
    access-control-allow-origin: *
    access-control-expose-headers: Content-Location

UTF-8 encoding search parameters issue

I test the fix on #60 , it's OK now, thanks!
Then I try some testing about Search by UTF-8 encoding parameters as below:

Bundle bundle = client.search().forResource(Organization.class).where(Organization.NAME.matchesExactly().value("測試醫院"))
                .prettyPrint().encodedJson().execute();

return the garbled one as http://fhirtest.uhn.ca/base/Organization?_id=6030
it shall be no garbled one as http://fhirtest.uhn.ca/base/Organization?_id=6032

It seems a server issue diff with the client issue at #60

contained resources are duplicated to top-level bundle when paging to "previous"

I am using FifoMemoryPagingProvider and SimpleBundleProvider to store+page my resources. The first page of results appears as expected, and so does the second page when hitting the rel=next link. But when I go back to the first page following the rel=previous link, the resources which were previously contained are duplicated as top-level bundle resources with the generated ID (locally scoped) appearing as if it were globally scoped.

As an example, a single DiagnosticReport in the bundle has contained Observations.

{
  resourceType: 'DiagnosticReport',
  contained: [{
    resourceType: 'Observation',
    id: 1
  }],
  result: [{
    reference: '#1'
  }]
}

When I return to this page (going next then previous), these Observations appear in the top-level bundle.

{
  entry: [{
    content: {
      resourceType: 'DiagnosticReport',
      contained: [{
        resourceType: 'Observation',
        id: 1
      }],
      result: [{
        reference: 'Observation/1'
      }]
    }
  },{
    content: {
      resourceType: 'Observation',
      id: 1
    }
  }]
}

Sorry, these aren't exact examples, but I hope it helps to visualize the problem I'm describing.

testHistoryWithParams test case fails

One of the test case is failing for us when running mvn install

testHistoryWithParams inside hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java

Line 540:
assertThat(capt.getAllValues().get(1).getURI().toString(), containsString("_since="+expectedDateString));

Throws the error

Expected: "_since=2012-01-02T00%3A01%3A02.000+13%3A00"
but: "......_since=2012-01-02T00%3A01%3A02.000%2B13%3A00...."

*with some useless data removed

It seems like when it adds the + for the timezone it encodes it to its url encoded value (%2B) in one case, but leaves it as + for the other case.

Exception message string issue

Exceptions returned from the FHIR server contain the message string in the response body. On the client side, calling getMessage() on the exception only obtains minimal information (e.g. HTTP 500 Internal Server Error), the client needs to cast the exception to BaseServerResponseException and call getResponseBody and then navigate to the issue.details field to obtain the message string. It would be more useful to have the message string added to the message field in the Exception object. Most logging logic in java prints/logs data from the message field.

Calling toString on ValidationResult Causes success to become false

The toString method in ValidationResult calls the toDescription method which will invoke the getIssueFirstRep method on the operation outcome. Unfortunately this method will add a new issue to the operation outcome if one didn't already exist. The success method of ValidationResult attempts to use the lack of issues as an indicator of success. This isn't always a true condition though given how the operation outcome class works.

Since I introduced this bug I will work on a PR to fix it. Sorry about that.

Unable to run HAPI-FHIR based server under Tomcat-6

Hello,
we were able to run demo version of our radiology apps based on HAPI 0.3 under Tomcat-8, but we would like to be able to run it under Tomcat-6 since our existing cust PROD env uses Tomcat-6 to run other existing apps.

Please provide direction on how to do this.
Thank you
Bernard

_include can break uhn.fhirtest

The following request causes a 500:
http://fhirtest.uhn.ca/base/Observation/_search?subject%3APatient._id=d1132446701&_count=999&_include=Observation.subject

Stack trace:
java.lang.NumberFormatException: For input string: "d1132446701"

java.lang.NumberFormatException: For input string: "d1132446701"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Long.parseLong(Long.java:441)
at java.lang.Long.parseLong(Long.java:483)
at ca.uhn.fhir.model.primitive.IdDt.getIdPartAsLong(IdDt.java:229)
at ca.uhn.fhir.jpa.dao.BaseFhirDao.loadResourcesById(BaseFhirDao.java:959)
at ca.uhn.fhir.jpa.dao.FhirResourceDao$2$1.doInTransaction(FhirResourceDao.java:534)
at ca.uhn.fhir.jpa.dao.FhirResourceDao$2$1.doInTransaction(FhirResourceDao.java:481)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
at ca.uhn.fhir.jpa.dao.FhirResourceDao$2.getResources(FhirResourceDao.java:481)
at ca.uhn.fhir.rest.server.RestfulServer.createBundleFromBundleProvider(RestfulServer.java:990)
at ca.uhn.fhir.rest.method.BaseResourceReturningMethodBinding.invokeServer(BaseResourceReturningMethodBinding.java:243)
at ca.uhn.fhir.rest.method.SearchMethodBinding.invokeServer(SearchMethodBinding.java:56)
at ca.uhn.fhir.rest.server.RestfulServer.handleRequest(RestfulServer.java:616)
at ca.uhn.fhir.rest.server.RestfulServer.doGet(RestfulServer.java:125)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.ebaysf.web.cors.CORSFilter.handleNonCORS(CORSFilter.java:437)
at org.ebaysf.web.cors.CORSFilter.doFilter(CORSFilter.java:172)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
at java.lang.Thread.run(Thread.java:722)

Note that the patient is readable via a patient request, so it doesn't seem to be bogus data in the patient.

Issue calling search methods using the annotation client

I created a ResourceProvider and client with the following two search method signatures:

@Search
public List search(
@OptionalParam(name=Location.SP_NAME) StringParam theName,
) {}

@Search
public List searchById(
@RequiredParam(name = "_id") StringParam theId,
) {}

When calling "searchById" in the client, the fhir server ended up executing the "search" method. When I changed the name of the "search" method in the client and the ResourceProvider to something else (e.g. "seachByName") the issue went away. Note, the queryName search annotation attribute was not used. I think the fhir server gets confused when the method has a name of "search" and or when the parameter types are the same across multiple methods.

Updating a resource with a tag it already has creates duplicate tags

While messing around with updating resources and adding tags to them, I noticed that every time I update a resource on the HAPI test server and include a profile tag in the update, a new instance of the tag is added to the resource's tag list.

Fiddler output for the resource in question:

HTTP/1.1 200 OK
Date: Fri, 26 Sep 2014 13:43:54 GMT
Server: GlassFish Server Open Source Edition 4.0
Content-Location: http://fhirtest.uhn.ca/base/Observation/4041/_history/4
X-Powered-By: HAPI FHIR 0.6-SNAPSHOT RESTful Server
Last-Modified: 2014-09-23T12:45:05.913-04:00
Category: http://fhirstorm.dyndns.org:8080/FhirStorm/fhir/Profile/Observation; scheme="http://hl7.org/fhir/tag/profile"
Category: http://fhirstorm.dyndns.org:8080/FhirStorm/fhir/Profile/Observation; scheme="http://hl7.org/fhir/tag/profile"
Category: http://fhirstorm.dyndns.org:8080/FhirStorm/fhir/Profile/Observation; scheme="http://hl7.org/fhir/tag/profile"
Category: http://fhirstorm.dyndns.org:8080/FhirStorm/fhir/Profile/Observation; scheme="http://hl7.org/fhir/tag/profile"
Category: http://fhirstorm.dyndns.org:8080/FhirStorm/fhir/Profile/Observation; scheme="http://hl7.org/fhir/tag/profile"
Category: http://fhirstorm.dyndns.org:8080/FhirStorm/fhir/Profile/Observation; scheme="http://hl7.org/fhir/tag/profile"
Category: http://fhirstorm.dyndns.org:8080/FhirStorm/fhir/Profile/Observation; scheme="http://hl7.org/fhir/tag/profile"
Category: http://fhirstorm.dyndns.org:8080/FhirStorm/fhir/Profile/Observation; scheme="http://hl7.org/fhir/tag/profile"
Content-Type: application/xml+fhir;charset=UTF-8
Connection: close
Transfer-Encoding: chunked

30d

No narrative template available for resource profile: http://hl7.org/fhir/profiles/Observation

0

error in hapi-fhir-base unit test

hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ResfulServerMethodTest.java
line 289
assertEquals(404, status.getStatusLine().getStatusCode());
it supposed to be a 404,but it actually return 500

Automatically generated profiles aren't schema-compliant

Add a new ResourceProvider to the RESTful Server Example (I did Observation).
Retrieve the automatically generated profile from the server
Attempt to validate the profile against fhir-all.xsd.
Validation will fail, as the profile is missing the "status" element (this is the first of a bunch of missing things, I added 5 before I gave up)

problem with search param names

I made a search method for a resource provider with the following signature:

@Search
public List searchByName(
@OptionalParam(name="partof") ReferenceParam thePartOfId,
@OptionalParam(name="partof.name") StringParam thePartOfName,
) {

When calling the method from my annotation client and passing in values for both parameters i got the following exception:

HTTP 400 Bad Request: Multiple values detected for non-repeatable parameter 'partof'. This server is not configured to allow multiple (AND/OR) values for this param.

That's not such a big deal because my intention is to have the caller use only one of the parameters but not both. Although, when calling the method with only the second parameter supplied (i.e. "partof.name") the server mapped the value to the first parameter. Thus in the resource provider object the "partof" parameter was populated with the value that should have been mapped to the "partof.name" parameter.

As workaround I'm going to try using a parameter name of "_partof.name" instead. I have a feeling that should work but it's not the preferred approach.

Remove Resource.profile() and use id() instead

After talking with James, the way profile tags are added for custom resources is a bit confusing, and unless you can provide the complete url to your profile, there doesn't seem to be a good way to use the custom profile tagging feature.

So, we think profile() should be removed, and the profile should be based on the id(), augmented by the server address strategy.
That is... if:
@ResourceDef(name="DiagnosticReport", id="customdiagnosticreport")
public class CustomDiagnosticReport...

and your server was at
http://myserver.zippy.com/fhir

your profile tag would end up
http://myserver.zippy.com/fhir/Profile/customdiagnosticreport

JPA transaction doesn't respect cid: URIs

Per the transaction definition: http://hl7.org/implement/standards/fhir/http.html#transaction

A client may assign temporary ids to new resources and then refer to them from other places in the transaction. When the client intends a resource to have a transient identity that the server must replace, it should use a cid: url on the resource - that is, a url with the scheme "cid:" per RFC 2392. Servers SHALL replace these temporary ids when processing the transaction.

The JPA module currently saves these "cid:" URIs as is, which is wrong.

search param "_language" bug

create a patient with the below

<Patient xmlns="http://hl7.org/fhir">
     <language value="zh-CN"/>   
    <text>
      <status value="generated"/>
      <div xmlns="http://www.w3.org/1999/xhtml">Zimmerman, Mr Brian,</div>
    </text>
    <identifier>
      <use value="usual"/>
      <label value="URNo"/>
      <value value="89532"/>
    </identifier>
    <name>
      <text value="王海生"/>
      <family value="王"/>
      <given value="海生"/>
    </name>
    <telecom>
      <system value="phone"/>
      <value value="9899 9878"/>
      <use value="home"/>
    </telecom>
    <telecom>
      <system value="email"/>
      <value value="[email protected]"/>
      <use value="home"/>
    </telecom>
    <gender>
      <coding>
        <system value="http://hl7.org/fhir/v3/AdministrativeGender"/>
        <code value="M"/>
        <display value="Male"/>
      </coding>
      <text value="Male"/>
    </gender>
    <birthDate value="1997-01-01"/>
    <address id="1c1f583f220d4c06984909210ba9e6ed">
      <use value="home"/>
      <text value="99 Houston Road, BENTLEIGH, 3204"/>
      <line value="99 Houston Road"/>
      <city value="BENTLEIGH"/>
      <state value="Victoria"/>
      <zip value="3204"/>
      <period>
        <start value="2006-06-16"/>
      </period>
    </address>
    <active value="true"/>
</Patient>

then GET http://fhirtest.uhn.ca/base/Patient/_search?_language=zh-CN
return 13
it is supposed to be 1

Enhancement - ability to define a block of extensions in a class that's included by an annotation on a member variable

MyObservationWithExtensions.java demonstrates how to do nested extensions with HAPI.

I'd like a similar mechanism which would allow me to define a set of extensions in one place so that I can reuse them in multiple custom resources, then include them in the resources that needed them.

So we'd have a class like
@block(name = "Resource.StandardExtensions)
public class StandardExtensions
{
@child(name="idExt", order = 0)
@extension(url= Extensions.Id, definedLocally=true, isModifier=false)
@description(shortDefinition = "Contains the id of the resource")
private StringDt myIdExt;
// imagine setIdExt/getIdExt here

@Child(name="buildDate", order = 1)
@Extension(url = "urn:standardext:buildDate", definedLocally = true, isModifier = false)
private StringDt myBuildDate;
// imagine setBuildDate/getBuildDate here

...

}

Then in, say MyPatient:
...

@ExtensionBlock
private StandardExtensions myStandardExtensions;

Then when the profile-generator ripped through MyPatient, it'd add all of the extensions defined by StandardExtensions to my resource.

Create ImagingStudy Error

Hi, Jamesagnew:
I try to create a new ImagingStudy resource by following samples
http://fhir.healthintersections.com.au/open/ImagingStudy/1/
http://fhir.healthintersections.com.au/open/ImagingStudy/4/

Either in local hapi-fhir-jpaserver or uhn server(http://fhirtest.uhn.ca/base/ImagingStudy/) both return:
500 Internal Server Error
Failed to call access method

and error log from my local server:
2014-11-14 12:48:59.378 [http-8000-6] [192.168.100.7] [Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36] INFO o.h.e.i.StatisticalLoggingSessionEventListener Session Metrics {
1194565 nanoseconds spent acquiring 1 JDBC connections;
0 nanoseconds spent releasing 0 JDBC connections;
0 nanoseconds spent preparing 0 JDBC statements;
0 nanoseconds spent executing 0 JDBC statements;
0 nanoseconds spent executing 0 JDBC batches;
0 nanoseconds spent performing 0 L2C puts;
0 nanoseconds spent performing 0 L2C hits;
0 nanoseconds spent performing 0 L2C misses;
0 nanoseconds spent executing 0 flushes (flushing a total of 0 entities and 0 collections);
0 nanoseconds spent executing 0 partial-flushes (flushing a total of 0 entities and 0 collections)
}
2014-11-14 12:48:59.394 [http-8000-6] [] [] ERROR c.u.f.r.m.BaseOutcomeReturningMethodBinding Internal error during method invocation
ca.uhn.fhir.rest.server.exceptions.InternalErrorException: Failed to call access method
at ca.uhn.fhir.rest.method.BaseMethodBinding.invokeServerMethod(BaseMethodBinding.java:195) ~[hapi-fhir-base-0.8-SNAPSHOT.jar:na]
at ca.uhn.fhir.rest.method.BaseOutcomeReturningMethodBinding.invokeServer(BaseOutcomeReturningMethodBinding.java:130) ~[hapi-fhir-base-0.8-SNAPSHOT.jar:na]
at ca.uhn.fhir.rest.method.CreateMethodBinding.invokeServer(CreateMethodBinding.java:36) [hapi-fhir-base-0.8-SNAPSHOT.jar:na]
at ca.uhn.fhir.rest.server.RestfulServer.handleRequest(RestfulServer.java:616) [hapi-fhir-base-0.8-SNAPSHOT.jar:na]
at ca.uhn.fhir.rest.server.RestfulServer.doPost(RestfulServer.java:135) [hapi-fhir-base-0.8-SNAPSHOT.jar:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) [servlet-api.jar:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) [servlet-api.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) [catalina.jar:6.0.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.26]
at org.ebaysf.web.cors.CORSFilter.handleSimpleCORS(CORSFilter.java:302) [cors-filter-1.0.1.jar:na]
at org.ebaysf.web.cors.CORSFilter.doFilter(CORSFilter.java:164) [cors-filter-1.0.1.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:6.0.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.26]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) [catalina.jar:6.0.26]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [catalina.jar:6.0.26]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [catalina.jar:6.0.26]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [catalina.jar:6.0.26]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [catalina.jar:6.0.26]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) [catalina.jar:6.0.26]
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859) [tomcat-coyote.jar:6.0.26]
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579) [tomcat-coyote.jar:6.0.26]
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555) [tomcat-coyote.jar:6.0.26]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_72]
Caused by: java.lang.reflect.InvocationTargetException: null
at sun.reflect.GeneratedMethodAccessor232.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_72]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_72]
at ca.uhn.fhir.rest.method.BaseMethodBinding.invokeServerMethod(BaseMethodBinding.java:190) ~[hapi-fhir-base-0.8-SNAPSHOT.jar:na]
... 22 common frames omitted
Caused by: ca.uhn.fhir.context.ConfigurationException: Invalid path:
at ca.uhn.fhir.util.FhirTerser.getValues(FhirTerser.java:87) ~[hapi-fhir-base-0.8-SNAPSHOT.jar:na]
at ca.uhn.fhir.jpa.dao.BaseFhirDao.extractSearchParamNumber(BaseFhirDao.java:450) ~[hapi-fhir-jpaserver-base-0.8-SNAPSHOT.jar:na]
at ca.uhn.fhir.jpa.dao.BaseFhirDao.updateEntity(BaseFhirDao.java:1145) ~[hapi-fhir-jpaserver-base-0.8-SNAPSHOT.jar:na]
at ca.uhn.fhir.jpa.dao.FhirResourceDao.create(FhirResourceDao.java:161) ~[hapi-fhir-jpaserver-base-0.8-SNAPSHOT.jar:na]
at sun.reflect.GeneratedMethodAccessor233.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_72]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_72]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) ~[spring-aop-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) ~[spring-aop-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) ~[spring-tx-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:266) ~[spring-tx-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) ~[spring-tx-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) ~[spring-aop-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at com.sun.proxy.$Proxy65.create(Unknown Source) ~[na:na]
at ca.uhn.fhir.jpa.provider.JpaResourceProvider.create(JpaResourceProvider.java:54) ~[hapi-fhir-jpaserver-base-0.8-SNAPSHOT.jar:na]
... 26 common frames omitted

Can you help me to understand this problem? Thanks.
I try the same way to create new Patient resource is OK.

Organization resource does not support _history well

run

http://fhirtest.uhn.ca/base/Organization/2.16.840.1.113883.3.239.23.21/_history/4

is ok ,but

http://fhirtest.uhn.ca/base/Organization/2.16.840.1.113883.3.239.23.21/_history
http://fhirtest.uhn.ca/base/Organization/2.16.840.1.113883.3.239.23.21/_history/1
http://fhirtest.uhn.ca/base/Organization/2.16.840.1.113883.3.239.23.21/_history/2
http://fhirtest.uhn.ca/base/Organization/2.16.840.1.113883.3.239.23.21/_history/3

return the following

<OperationOutcome>
<text>
<status value="empty"/>
<div>
No narrative template available for resource profile: http://hl7.org/fhir/profiles/OperationOutcome
</div>
</text>
<issue>
<severity value="error"/>
<details value="ca.uhn.fhir.rest.server.exceptions.InternalErrorException: Failed to call access method ca.uhn.fhir.rest.server.exceptions.InternalErrorException: Failed to call access method at ca.uhn.fhir.rest.method.BaseMethodBinding.invokeServerMethod(BaseMethodBinding.java:199) at ca.uhn.fhir.rest.method.HistoryMethodBinding.invokeServer(HistoryMethodBinding.java:162) at ca.uhn.fhir.rest.method.BaseResourceReturningMethodBinding.invokeServer(BaseResourceReturningMethodBinding.java:199) at ca.uhn.fhir.rest.method.HistoryMethodBinding.invokeServer(HistoryMethodBinding.java:46) at ca.uhn.fhir.rest.server.RestfulServer.handleRequest(RestfulServer.java:555) at ca.uhn.fhir.rest.server.RestfulServer.doGet(RestfulServer.java:162) at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188) at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544) at java.lang.Thread.run(Thread.java:722) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at ca.uhn.fhir.rest.method.BaseMethodBinding.invokeServerMethod(BaseMethodBinding.java:194) ... 34 more Caused by: java.lang.NumberFormatException: For input string: "2.16.840.1.113883.3.239.23.21" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Long.parseLong(Long.java:441) at java.lang.Long.parseLong(Long.java:483) at ca.uhn.fhir.model.primitive.IdDt.getIdPartAsLong(IdDt.java:203) at ca.uhn.fhir.jpa.provider.JpaResourceProvider.getHistoryForResourceInstance(JpaResourceProvider.java:78) ... 39 more "/>
</issue>
</OperationOutcome>

FhirContext xml pretty print issue

This is low priority. When printing the contents of a resource using "FhirContext#newXmlParser().setPrettyPrint(true).encodeResourceToString()" several duplicate resources appear in the "contained" element when they should not be there.

Create resource including Chinese words (encoding by UTF-8) issue

I testing IGenericClient to create resource with some Chinese words as below:

String name = "測試醫院";
Organization org = new Organization();
        org.setName(new String(name.getBytes(), "UTF-8")).addIdentifier("2.16.886.101.20003.20014.20006", "1531000001");
...
MethodOutcome mo = client.create().resource(org)
            .prettyPrint().encodedXml().execute();

Console Log:
2014/12/11 18:01:58 ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor interceptRequest
Client request body:

<Organization xmlns="http://hl7.org/fhir"><identifier><system value="2.16.886.101.20003.20014.20006"/><value value="1531000001"/></identifier><name value="測試醫院"/><telecom><value value="0912345678"/></telecom><location><reference value="[email protected]"/></location></Organization>

It success at http://fhirtest.uhn.ca/base/Organization?_id=6030
but the name of Organization is garbled. It seems reading by "ISO-8859-1".

Then I try to sent same xml by POSTMAN (a chrome plugin tool)
It success at http://fhirtest.uhn.ca/base/Organization?_id=6032
there is no garbled.

I try to modify class ca.uhn.fhir.rest.method.BaseHttpClientInvocationWithContents

entity = new StringEntity(contents, ContentType.create(contentType, "UTF-8"));
entity.setContentEncoding("UTF-8");  // add this line after new StringEntity

same result, Chinese word still become garbled.
Is the client issue or server issue? Thanks.

DateDt missing precision check during initialization

Valid precision for DateDt is YEAR,MONTH or DAY.

Initialization should check this.

If SECOND is giving, parsing has a problem and thows DataFormatException -> "Invalid date/time string (data type does not support SECONDS precision"

References are not generated correctly in JSON

See the example:
http://www.hl7.org/implement/standards/fhir/encounter-examples.html

The subject reference should say reference:

{
  "subject": {
    "reference": "Patient/example"
  }
}

However, the JSON that HAPI generates says resource instead of reference:

{
  "subject": {
    "resource": "Patient/example"
  }
}

The XML correctly produces:

<subject>
  <reference value="Patient/example"/>
</subject>

This seems to occur for all references, regardless of resource. I think the culprit is ca.uhn.fhir.parser.JsonParser:295, where it is explicitly writing "resource". This was found in version 0.5

A problem with processing search parameters with similar paths

I made a search method for a resource provider with the following signature:

@Search
public List searchByName(
@OptionalParam(name="partof") ReferenceParam thePartOfId,
@OptionalParam(name="partof.name") StringParam thePartOfName,
) {

When calling the method from my annotation client and passing in values for both parameters i got the following exception:

HTTP 400 Bad Request: Multiple values detected for non-repeatable parameter 'partof'. This server is not configured to allow multiple (AND/OR) values for this param.

That's not such a big deal because my intention is to have the caller use only one of the parameters but not both. Although, when calling the method with only the second parameter supplied (i.e. "partof.name") the server mapped the value to the first parameter. Thus in the resource provider object the "partof" parameter was populated with the value that should have been mapped to the "partof.name" parameter.

As workaround I'm going to try using a parameter name of "_partof.name" instead. I have a feeling that should work but it's not the preferred approach.

AddProfileTagEnum shoud be public

RestfulServer has a public method setAddProfileTag which takes AddProfileTagEnum as an argument. However, AddProfileTagEnum has package visibility. The method and the enum should have the same visibility, public.

valueset _history bug

I have create a valueset resource,when I try to run
http://fhirtest.uhn.ca/base/ValueSet/3cb9a027-9e02-488d-8d01-952553d6be4e/_history
it return

<OperationOutcome>
<text>
<status value="empty"/>
<div>
No narrative template available for resource profile: http://hl7.org/fhir/profiles/OperationOutcome
</div>
</text>
<issue>
<severity value="error"/>
<details value="ca.uhn.fhir.rest.server.exceptions.InternalErrorException: Failed to call access method ca.uhn.fhir.rest.server.exceptions.InternalErrorException: Failed to call access method at ca.uhn.fhir.rest.method.BaseMethodBinding.invokeServerMethod(BaseMethodBinding.java:199) at ca.uhn.fhir.rest.method.HistoryMethodBinding.invokeServer(HistoryMethodBinding.java:162) at ca.uhn.fhir.rest.method.BaseResourceReturningMethodBinding.invokeServer(BaseResourceReturningMethodBinding.java:228) at ca.uhn.fhir.rest.method.HistoryMethodBinding.invokeServer(HistoryMethodBinding.java:1) at ca.uhn.fhir.rest.server.RestfulServer.handleRequest(RestfulServer.java:534) at ca.uhn.fhir.rest.server.RestfulServer.doGet(RestfulServer.java:141) at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) at org.ebaysf.web.cors.CORSFilter.handleNonCORS(CORSFilter.java:437) at org.ebaysf.web.cors.CORSFilter.doFilter(CORSFilter.java:172) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188) at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544) at java.lang.Thread.run(Thread.java:722) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at ca.uhn.fhir.rest.method.BaseMethodBinding.invokeServerMethod(BaseMethodBinding.java:194) ... 40 more Caused by: java.lang.NumberFormatException: For input string: "3cb9a027-9e02-488d-8d01-952553d6be4e" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Long.parseLong(Long.java:441) at java.lang.Long.parseLong(Long.java:483) at ca.uhn.fhir.model.primitive.IdDt.getIdPartAsLong(IdDt.java:194) at ca.uhn.fhir.jpa.provider.JpaResourceProvider.getHistoryForResourceInstance(JpaResourceProvider.java:81) ... 45 more "/>
</issue>
</OperationOutcome>

problem with search param names

I made a search method for a resource provider with the following signature:

@Search
public List searchByName(
@OptionalParam(name="partof") ReferenceParam thePartOfId,
@OptionalParam(name="partof.name") StringParam thePartOfName,
) {

When calling the method from my annotation client and passing in values for both parameters i got the following exception:

HTTP 400 Bad Request: Multiple values detected for non-repeatable parameter 'partof'. This server is not configured to allow multiple (AND/OR) values for this param.

That's not such a big deal because my intention is to have the caller use only one of the parameters but not both. Although, when calling the method with only the second parameter supplied (i.e. "partof.name") the server mapped the value to the first parameter. Thus in the resource provider object the "partof" parameter was populated with the value that should have been mapped to the "partof.name" parameter.

As workaround I'm going to try using a parameter name of "_partof.name" instead. I have a feeling that should work but it's not the preferred approach.

Resource history operation bug

When the annotation client tries to call an instance level history operation on a resource provider, if the resource provider has a vread operation implemented then it seems
that the history operation does not get invoked, but the vread operation gets invoked instead. James, you can test this out using http://uhnveng10.uhn.ca:8080/svn/syseng/Java/cGTA-CVP/uhn-fhir-service/trunk/src/main/java/ca/uhn/fhir/client/DiagnosticReportClientExample.java
Just run the getAppGennedDiagnosticReportHistory method from this class and check the log file on the server side, you'll notice that the getDiagnosticReport method is being invoked instead (this is the method annotated with @READ(version=true)).

Suggested code tweaks

James,

I'm subclassing some of your classes to introduce some new behaviors. Some simple changes would help me greatly:

FhirContext - add a setRestfulClientFactory method.
BaseClient - elevate invokeClient method visibility from package to protected.
GenericClient - add a getFhirContext method
RestfulClientFactory - add a getFhirContext method

Thanks for considering these changes.

Support for latest FHIR-Dev and DSTU versions

When will the latest FHIR-Dev and DSTU be supported?

FHIR-Dev:
DeviceObservationReport has been deprecated in the latest FHIR Dev: http://hl7.org/implement/standards/FHIR-develop/resourcelist.html. The HAPI-FHIR-0.7 and HAPI-FHIR-0.8-SNAPSOT still contain this resource. I see it at https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-tinder-plugin/src/main/resources/res/dev/deviceobservationreport-spreadsheet.xml. This spreadsheet specifies that it was saved on 2013-06-22.

FHIR-DSTU
The version in the pom, https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-structures-dstu/pom.xml, shows FHIR 0.80. Is it for DSTU 1 (v0.0.80) or latest DSTU 1 (v0.0.82)?

Resource Id data not available when the resource is returned from a read operation

When a read operation returns a resource the resource's logical id is not supplied in the response since the FHIR spec does not allow it. On the otherhand the java object for the resource does have a field for the logical id and it's set to blank/null in this situation. For completeness it would be nice to have this field populated, maybe add logic to the FHIR client to populate this field before passing the resource object back to the caller.

Unable to run HAPI-FHIR based server under Tomcat-6

Hello,
we were able to run demo version of our radiology apps based on HAPI 0.3 under Tomcat-8, but we would like to be able to run it under Tomcat-6 since our existing cust PROD env uses Tomcat-6 to run other existing apps.

Please provide direction on how to do this.
Thank you
Bernard

Practitioner create bug

when I run

POST  http://fhirtest.uhn.ca/base/Practitioner 
<?xml version="1.0" encoding="UTF-8"?>
<Practitioner 
    xmlns="http://hl7.org/fhir">
    <text>
        <status value="generated"/>
        <div 
            xmlns="http://www.w3.org/1999/xhtml">Verify, Virgil. SSN:&#x0A;            999999999
        </div>
    </text>
    <identifier>
        <label value="SSN"/>
        <system value="http://hl7.org/fhir/sid/us-ssn"/>
        <value value="999999999"/>
    </identifier>
    <name>
        <use value="official"/>
        <family value="Verify"/>
        <given value="Virgil"/>
    </name>
    <telecom>
        <system value="phone"/>
        <value value="555-555-1008"/>
        <use value="work"/>
    </telecom>
    <address>
        <use value="home"/>
        <line value="1008 Healthcare Drive"/>
    </address>
    <gender>
        <coding>
            <system value="http://hl7.org/fhir/v3/AdministrativeGender"/>
            <code value="M"/>
        </coding>
    </gender>
    <organization>
        <reference value="Organization/hl7"/>
    </organization>
</Practitioner>

it return



    Status Code: 400 Bad Request
    Connection: close
    Content-Length: 137
    Content-Type: text/plain;charset=ISO-8859-1
    Date: Wed, 06 Aug 2014 09:04:32 GMT
    Server: GlassFish Server Open Source Edition 4.0
    X-Powered-By: HAPI FHIR 0.6-SNAPSHOT RESTful Server
    access-control-allow-methods: GET, POST, PUT, DELETE
    access-control-allow-origin: *
    access-control-expose-headers: Content-Location

Resource Organization/hl7 not found, specified in path: Practitioner.organization (this is an invalid ID, must be numeric on this server)

Provide Validation API that does not use exceptions

I believe it would make for more usable API if the FhirValidator class would return some sort of ValidationResult object rather than returning void but throwing exceptions if there is a validation issue. Handling exceptions for something as generally expected as validation errors seems to create less code which is more difficult to follow. There is some good explanation here about why this is an anti-pattern.

If this was an intentional design decision then we will use the existing API. If you would like to see an alternative API I would be more than happy to create a pull request for adding a new API for validation errors.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.