Site updates and clean up RI IdType
This commit is contained in:
parent
834710df9b
commit
11d22b1b1f
|
@ -26,11 +26,15 @@ import ca.uhn.fhir.parser.DataFormatException;
|
|||
|
||||
public interface IPrimitiveDatatype<T> extends IDatatype, IPrimitiveType<T> {
|
||||
|
||||
@Override
|
||||
void setValueAsString(String theValue) throws DataFormatException;
|
||||
|
||||
@Override
|
||||
String getValueAsString() throws DataFormatException;
|
||||
|
||||
@Override
|
||||
T getValue();
|
||||
|
||||
@Override
|
||||
IPrimitiveType<T> setValue(T theValue) throws DataFormatException;
|
||||
}
|
||||
|
|
|
@ -59,7 +59,6 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
private String myResourceType;
|
||||
private String myUnqualifiedId;
|
||||
private String myUnqualifiedVersionId;
|
||||
private volatile String myValue;
|
||||
|
||||
/**
|
||||
* Create a new empty ID
|
||||
|
@ -179,6 +178,18 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
setValue(theUrl.getValueAsString());
|
||||
}
|
||||
|
||||
public void applyTo(IBaseResource theResouce) {
|
||||
if (theResouce == null) {
|
||||
throw new NullPointerException("theResource can not be null");
|
||||
} else if (theResouce instanceof IResource) {
|
||||
((IResource) theResouce).setId(new IdDt(getValue()));
|
||||
} else if (theResouce instanceof IAnyResource) {
|
||||
((IAnyResource) theResouce).setId(getValue());
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unknown resource class type, does not implement IResource or extend Resource");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #getIdPartAsBigDecimal()} instead (this method was deprocated because its name is ambiguous)
|
||||
*/
|
||||
|
@ -187,6 +198,15 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
return getIdPartAsBigDecimal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object theArg0) {
|
||||
if (!(theArg0 instanceof IdDt)) {
|
||||
return false;
|
||||
}
|
||||
IdDt id = (IdDt) theArg0;
|
||||
return StringUtils.equals(getValueAsString(), id.getValueAsString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this IdDt matches the given IdDt in terms of resource type and ID, but ignores the URL base
|
||||
*/
|
||||
|
@ -201,22 +221,6 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
return ObjectUtils.equals(getResourceType(), theId.getResourceType()) && ObjectUtils.equals(getIdPart(), theId.getIdPart()) && ObjectUtils.equals(getVersionIdPart(), theId.getVersionIdPart());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object theArg0) {
|
||||
if (!(theArg0 instanceof IdDt)) {
|
||||
return false;
|
||||
}
|
||||
IdDt id = (IdDt) theArg0;
|
||||
return StringUtils.equals(getValueAsString(), id.getValueAsString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
HashCodeBuilder b = new HashCodeBuilder();
|
||||
b.append(getValueAsString());
|
||||
return b.toHashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the portion of this resource ID which corresponds to the server base URL. For example given the resource ID <code>http://example.com/fhir/Patient/123</code> the base URL would be
|
||||
* <code>http://example.com/fhir</code>.
|
||||
|
@ -224,6 +228,7 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
* This method may return null if the ID contains no base (e.g. "Patient/123")
|
||||
* </p>
|
||||
*/
|
||||
@Override
|
||||
public String getBaseUrl() {
|
||||
return myBaseUrl;
|
||||
}
|
||||
|
@ -231,6 +236,7 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
/**
|
||||
* Returns only the logical ID part of this ID. For example, given the ID "http://example,.com/fhir/Patient/123/_history/456", this method would return "123".
|
||||
*/
|
||||
@Override
|
||||
public String getIdPart() {
|
||||
return myUnqualifiedId;
|
||||
}
|
||||
|
@ -255,6 +261,7 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
* @throws NumberFormatException
|
||||
* If the value is not a valid Long
|
||||
*/
|
||||
@Override
|
||||
public Long getIdPartAsLong() {
|
||||
String val = getIdPart();
|
||||
if (isBlank(val)) {
|
||||
|
@ -263,6 +270,7 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
return Long.parseLong(val);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getResourceType() {
|
||||
return myResourceType;
|
||||
}
|
||||
|
@ -274,7 +282,7 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
*/
|
||||
@Override
|
||||
public String getValue() {
|
||||
if (myValue == null && myHaveComponentParts) {
|
||||
if (super.getValue() == null && myHaveComponentParts) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
if (isNotBlank(myBaseUrl)) {
|
||||
b.append(myBaseUrl);
|
||||
|
@ -299,9 +307,9 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
b.append(myUnqualifiedVersionId);
|
||||
}
|
||||
String value = b.toString();
|
||||
myValue = value;
|
||||
super.setValue(value);
|
||||
}
|
||||
return myValue;
|
||||
return super.getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -309,6 +317,7 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
return getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersionIdPart() {
|
||||
return myUnqualifiedVersionId;
|
||||
}
|
||||
|
@ -330,14 +339,24 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
return isNotBlank(myBaseUrl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
HashCodeBuilder b = new HashCodeBuilder();
|
||||
b.append(getValueAsString());
|
||||
return b.toHashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasIdPart() {
|
||||
return isNotBlank(getIdPart());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasResourceType() {
|
||||
return isNotBlank(myResourceType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasVersionIdPart() {
|
||||
return isNotBlank(getVersionIdPart());
|
||||
}
|
||||
|
@ -345,6 +364,7 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
/**
|
||||
* Returns <code>true</code> if this ID contains an absolute URL (in other words, a URL starting with "http://" or "https://"
|
||||
*/
|
||||
@Override
|
||||
public boolean isAbsolute() {
|
||||
if (StringUtils.isBlank(getValue())) {
|
||||
return false;
|
||||
|
@ -352,9 +372,15 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
return UrlUtil.isAbsolute(getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return isBlank(getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the unqualified ID is a valid {@link Long} value (in other words, it consists only of digits)
|
||||
*/
|
||||
@Override
|
||||
public boolean isIdPartValidLong() {
|
||||
String id = getIdPart();
|
||||
if (StringUtils.isBlank(id)) {
|
||||
|
@ -371,6 +397,7 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
/**
|
||||
* Returns <code>true</code> if the ID is a local reference (in other words, it begins with the '#' character)
|
||||
*/
|
||||
@Override
|
||||
public boolean isLocal() {
|
||||
return myUnqualifiedId != null && myUnqualifiedId.isEmpty() == false && myUnqualifiedId.charAt(0) == '#';
|
||||
}
|
||||
|
@ -378,6 +405,7 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
/**
|
||||
* Copies the value from the given IdDt to <code>this</code> IdDt. It is generally not neccesary to use this method but it is provided for consistency with the rest of the API.
|
||||
*/
|
||||
@Override
|
||||
public void setId(IdDt theId) {
|
||||
setValue(theId.getValue());
|
||||
}
|
||||
|
@ -396,16 +424,16 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
@Override
|
||||
public IdDt setValue(String theValue) throws DataFormatException {
|
||||
// TODO: add validation
|
||||
myValue = theValue;
|
||||
super.setValue(theValue);
|
||||
myHaveComponentParts = false;
|
||||
if (StringUtils.isBlank(theValue)) {
|
||||
myBaseUrl = null;
|
||||
myValue = null;
|
||||
super.setValue(null);
|
||||
myUnqualifiedId = null;
|
||||
myUnqualifiedVersionId = null;
|
||||
myResourceType = null;
|
||||
} else if (theValue.charAt(0) == '#') {
|
||||
myValue = theValue;
|
||||
super.setValue(theValue);
|
||||
myUnqualifiedId = theValue;
|
||||
myUnqualifiedVersionId = null;
|
||||
myResourceType = null;
|
||||
|
@ -469,18 +497,22 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
* Returns a new IdDt containing this IdDt's values but with no server base URL if one is present in this IdDt. For example, if this IdDt contains the ID "http://foo/Patient/1", this method will
|
||||
* return a new IdDt containing ID "Patient/1".
|
||||
*/
|
||||
@Override
|
||||
public IdDt toUnqualified() {
|
||||
return new IdDt(getResourceType(), getIdPart(), getVersionIdPart());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IdDt toUnqualifiedVersionless() {
|
||||
return new IdDt(getResourceType(), getIdPart());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IdDt toVersionless() {
|
||||
return new IdDt(getBaseUrl(), getResourceType(), getIdPart(), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IdDt withResourceType(String theResourceName) {
|
||||
return new IdDt(theResourceName, getIdPart(), getVersionIdPart());
|
||||
}
|
||||
|
@ -495,6 +527,7 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
* The resource name (e.g. "Patient")
|
||||
* @return A fully qualified URL for this ID (e.g. "http://example.com/fhir/Patient/1")
|
||||
*/
|
||||
@Override
|
||||
public IdDt withServerBase(String theServerBase, String theResourceType) {
|
||||
return new IdDt(theServerBase, theResourceType, getIdPart(), getVersionIdPart());
|
||||
}
|
||||
|
@ -522,6 +555,24 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
return new IdDt(value + '/' + Constants.PARAM_HISTORY + '/' + theVersion);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the ID from the given resource instance
|
||||
*/
|
||||
public static IdDt of(IBaseResource theResouce) {
|
||||
if (theResouce == null) {
|
||||
throw new NullPointerException("theResource can not be null");
|
||||
} else {
|
||||
IIdType retVal = theResouce.getIdElement();
|
||||
if (retVal == null) {
|
||||
return null;
|
||||
} else if (retVal instanceof IdDt) {
|
||||
return (IdDt) retVal;
|
||||
} else {
|
||||
return new IdDt(retVal.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static String toPlainStringWithNpeThrowIfNeeded(BigDecimal theIdPart) {
|
||||
if (theIdPart == null) {
|
||||
throw new NullPointerException("BigDecimal ID can not be null");
|
||||
|
@ -536,41 +587,4 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
return theIdPart.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return isBlank(getValue());
|
||||
}
|
||||
|
||||
public void applyTo(IBaseResource theResouce) {
|
||||
if (theResouce == null) {
|
||||
throw new NullPointerException("theResource can not be null");
|
||||
} else if (theResouce instanceof IResource) {
|
||||
((IResource) theResouce).setId(new IdDt(getValue()));
|
||||
} else if (theResouce instanceof IAnyResource) {
|
||||
((IAnyResource) theResouce).setId(getValue());
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unknown resource class type, does not implement IResource or extend Resource");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the ID from the given resource instance
|
||||
*/
|
||||
public static IdDt of(IBaseResource theResouce) {
|
||||
if (theResouce == null) {
|
||||
throw new NullPointerException("theResource can not be null");
|
||||
} else if (theResouce instanceof IBaseResource) {
|
||||
IIdType retVal = ((IBaseResource) theResouce).getIdElement();
|
||||
if (retVal == null) {
|
||||
return null;
|
||||
} else if (retVal instanceof IdDt) {
|
||||
return (IdDt) retVal;
|
||||
} else {
|
||||
return new IdDt(retVal.getValue());
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unknown resource class type, does not implement IResource or extend Resource");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
package org.hl7.fhir.instance.model;
|
||||
|
||||
import org.hl7.fhir.instance.model.api.IBaseDatatype;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR - Core Library
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2015 University Health Network
|
||||
* %%
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
public interface IPrimitiveType<T> extends IBaseDatatype {
|
||||
|
||||
void setValueAsString(String theValue) throws IllegalArgumentException;
|
||||
|
||||
String getValueAsString();
|
||||
|
||||
T getValue();
|
||||
|
||||
IPrimitiveType<T> setValue(T theValue) throws IllegalArgumentException;
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mxfile userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:37.0) Gecko/20100101 Firefox/37.0" type="google"><diagram>7VhRb9owEP41PDaCpAnwWKC0L5sqMWnbo5s4iVXHRo5TYL++5+RMAgEadcCEtBeU+2Jf7O++O5/pedNs/aTIMv0mI8p7bj9a97xZz3UDdwC/BthUwL03rIBEsaiCcIQBFuwPRbCPaMEimu8M1FJyzZa7YCiFoKHewWLJ8RPobEkS674GFiHhbfQni3RaoSM3qPFnypLUfmYQjKs3ud5YHxGNScH1XQnBO/M6I9ZXuRDvEQhTUoIb85Stp5Qb0iwhHvViL/Djse+Ho8EwvKuWP+86fLsNRQUu9a9dIoPvhBe40YVWTCQz3WJglTJNF0sSGnsFquh5k1RnHKwBPMZS6AWOLm3G+VRyqcrZ3ng8n4/HgHfYBG70nSpNUXAlhJt6ojKjWm1giH07xH2gGgc+2qs63AMPsbQRaqsggqpLtq5rFuEBiexKql1/TWpInCIVTpwy5WQmlxzDgWIZ0+ydOl/l/CpcWvszLu8vwiWmWkugPzZLeksS9YIOErUUXl6iXotWqRIn5cNKo0zkmoiQGplWev0661dh85BID7F5GZHiQdJg87nIiPhOMnrbhdT9t4UUe4rPCmmU68J1QpktZQ7UAhRwWNfkVcFTYp5OhaNB/aHIXIXmrjXWhuO8NI+Oy/eWS+xB8V6vxGIP2b3Efpn0q5DZtcJeRKI2Qg1OaAQ9PppS6VQmUhD+WKMTJQsRUeOyv8sXXTP9y8COj9ZvHERF9KCUXIEZMZJJAbMNOAcZ28nCXmegz0PBN2xOXimfSBVRZXUvpDDL6R6lXBaqDPWpw0YTldCjjtCTIelktBXlxLSgOxelQ6HDqS+Sweq3KnFtkbIqsRcK66JaJc6qBQAkE/N5O2xpBuQtiWwX2kk1PiXxKPCGw6HrD4gfb0VfZ2BLRXlKoKPxZmGh+GaiSPhmOD14EDQEVCvrYl24TS3b4Fi7kX42KZrZNzpD9rV4bPfgL/bq0j5qZ0QTDW0iRHP/VYt9IMPgDWZzreQb3cuc5iGCEOEsEWCqausTwyyDG/8D4hmLorIIHIqkhNExL7M8hXEUJlwkiPtNqrUbMbTxOneP2ophu+G/2VzYEvRJLowvweN9i8ep7Tv/58KJIO7HMPDb7UT/WsmA94oj3QTSepX24VxNAbbwp5sCrAHnawqOBADM+m/Q6iCv/0T2Hj8A</diagram></mxfile>
|
|
@ -1,2 +1,2 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mxfile userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:37.0) Gecko/20100101 Firefox/37.0" type="google"><diagram>5Vnfb6M4EP5r8rgoQAnJY5M2e5XupNX2pLt7dMGAVceOjNk299fvGI8DAdpL24RudC+R/fn3N994PGQSrjbPXxXZFn/IlPJJME2fJ+HNJAhmgQ+/BthZ4CqMLZArlloIexjgnv1LEZwiWrGUlgcdtZRcs+0hmEghaKIPsExyXAIn25LcTd8A9wnhffQvlurCovNg1uC/UZYXbhl/trAtpd65OVKakYrrLzUEbaZ5Q9xc9UbCWyBMSQnTmNLmeUW5Ic0REtIwC2dRtoiiZO7HyRe7/fWx3ffHUFTgVj865dxO+YPwCs95tyQl/U5LWamE9lh4Kpim91sCTeHNEyhjEi4LveFQ86GYSaHvsXddZ5yvJJeqHh3eXN366whwXJUqTVFQx5yt7oMH+0rlhmq1gzE4QzBDNaAiI6w+NRb3rxArWtZ2IiIovHw/c0MkFJDLI3lF/bR4lSr3Ch57WcGUx0SpiUioZ0RkXMsjW+Z9nHrrZr6pl9CTifx3mplzAm8OWUqt5eYQ+450tKA/JSxQA2MYKz7SWA47qbHcndT2gkv0AN+xiKT6Qy4QjuUCoMIuqwnxqkJYF7CyN4sa5b+X7lFoHBLnEI3nESfGmrY4r8XuEvUZdpx+UJ+jXdF++K47+gPcj8Lp596kVz1OaApPMaxKpQuZS0H4bYMulaxESs2U00O+6DPTfxvYM4o0tX+wE7CldrYpqNtM3TTWw0R6rZR8guoDl8mjhdYg9P1o9yCtI6XdstnnG40C57Q6eD2saKJy+tJE9UOhb11FOdHsx+GOTmuqaHRTxb+uqfCS/UVNhXlK66b6BkuaI5/29l8s1uvFYqSwOvhAH+91gunqf71O0lJXgafwxvde4r3F8ZAJRuHzc58p/UzyAjXajaafm0T6b84i30n5KFR+6sPE2ef80e5tAa2btXPyQPlSqpQqp3khhdnM2UIfBpdXQ5/N5T4Q+3DoN8mMOvdfAdz15DTinkxuCrspHNWYHygmZnnXbWs6lD2B7Dd6lGYiSrL5LIzjOIh8EmWOvZb39TRUFmRrikml+G6pSPJoKBwMAS35NLo6WwrrnMh9ne37nvOItuv58xP4Xo/HfgLbJFAzbvh6UFDKTelOaKoyIM5as8010GN6tHgstZKPtOMn7XCBEOEsF1BV9qRLwzWDr8PXiG9YmtYOP2Q3Cb0zXnt0Af0oDDiLybp5nHOFlsmcdU59W/Ys1s+ML1b5x0r/LMrHbHhQ+dM7jN5QXHFSlkbyXXf4vzlB13jOKdpvhulYXoAZwgtPBqR1hDfC2SI/Ptlfj/z1XXD6rBeqzT9lNlo3/zOGtz8B</diagram></mxfile>
|
||||
<mxfile userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:37.0) Gecko/20100101 Firefox/37.0" type="google"><diagram>3Vnfb6M4EP5rIt09LApQ8uOxpM1upTupak+6u0cXDFh1cGScbXN//Y7xODhAu+k2Ie29RPjzD+xvvvHMkFG4WD1/lWRd/ClSykfBOH0ehVejIJgEPvxqYGuAi3BqgFyy1EA4QgP37D+K4BjRDUtptTdQCcEVW++DiShLmqg9LBMcX4GLrUlul2+A+4TwLvo3S1Vh0FkwafBvlOWFfY0/mZueSm3tGinNyIarLzUEfbp7Rexa9UbCayBMCgHL6KfV84JyTZolJKRhFk6ibB5FycyfJl/M9peHDt8dQ9ISt/reJWdmye+Eb/CcNzGp6B2txEYmtMPCU8EUvV8T6AqvnkAZozAu1IpDy4fHTJTqHkfXbcb5QnAh69nh1cW1v4wAx7dSqSgK6pCz1WPwYF+pWFEltzAHVwgmqAZUZITNp8bi/gVihWNtKyKCwst3KzdEwgNyeSCvqB+HVyFzr+BTLyuY9FhZKVIm1NMi0q7lkTXz3k+9cTNftysYycr8D5rpcwJvFomFUmK1j90hHQ70l4AX1MAQxpoeaCyLHdVY9k5yvaAxw/i3b5e3N7+PggmHTcQPEp5y/fSZnMO3BCPffp93hEN5Bwi0TXhCvE1RGu8wHqFfqp3iVx1iEBr7dNtH42l0i2HI1e1luXWle/fZhRu2Lope4Q52rfvhL93re0Y5v4o7nJ739r3ocEJTSN+wKaQqRC5Kwq8bNJZiU6ZULzne54s+M/WPhj2tSN36FwcBW3JruoK6T7d1Zz2tTC+lFE/QfOAieTTQEoS+m22T2Dq6mi3rfb7RKHBOo4PXQ5EiMqcvLVQnF13rSsqJYt/3d3RcU0WDm2r6cU2Ft+8HNRXWNs5NdQuv1EceLKOZz5fL+XygUNyb7w+X0WD1+7OMJq3UJvAkBgNvZ5IW7w7HfSYYhM/zpjbdwtSR7xBZzUnF247A5y1W/TdXqy/p9gMkM+ctJa19Th8h3xYE218HOHmgPBYypdJqvhSl3szJwiUGpFfDpSkM3xEvceqtYPVNYb822HvLasSmWXYJsymc1ZgfKCb69XbYWg+oOgLZbfQgzUSUZLNJOJ1Og8gnUWbZc7yvo6GqIGv9mGwk38aSJI+awt7Y4Min0dXJ6mHrRPYrcNf3rEe4rufPjuB7HR671XBTdLWDxU2pqMyAOGNNl2ugR49weKyUFI+05SduuECIcJaX0JTmpLHmmsFX6EvEVyxNa4fvs5uA0RmvPbqAcRQmnMRk7drPuoJjMmudY9+WHYt1q+lPq/xDpX8S5WMF3av88Q1Gb3hccFJVWvI/zZ3+507QNp51CjdnGA/lBVg6vJAyIK0D5Agni/yYy78e+eu74PiVMjSbf+RMtG7+zwyvfwA=</diagram></mxfile>
|
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
Binary file not shown.
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 24 KiB |
|
@ -11,11 +11,64 @@
|
|||
<section name="Upgrading to HAPI 1.1">
|
||||
|
||||
<p>
|
||||
HAPI 1.1 introduces support for the "reference i"
|
||||
Since the early days of FHIR, HL7.org has provided an
|
||||
open source "Java Reference Implementation", which is an implementation
|
||||
of a FHIR data model, parser, and client in Java.
|
||||
</p>
|
||||
<p>
|
||||
HAPI was originally started as a separate Java implementation of FHIR,
|
||||
but with a fairly different focus: implementing servers with an easily
|
||||
extendible data model. Over time though, the two Java implementations have
|
||||
shown a fair bit of overlap, so at the 2014
|
||||
<a href="http://fhir.furore.com/Events/DevDaysEval2014">DevDays</a> we decided
|
||||
to try and harmonize the two libraries.
|
||||
</p>
|
||||
<p>
|
||||
HAPI FHIR 1.1 begins the availability of a harmonized library. Note that
|
||||
this version has not yet been formally released, but is currently available in
|
||||
"snapshot" development builds.
|
||||
</p>
|
||||
<p>
|
||||
<b>For HAPI FHIR users:</b> This integration will bring the ability to use powerful features
|
||||
from the RI in your applications, such as the resource validator and the narrative
|
||||
generator.
|
||||
</p>
|
||||
<p>
|
||||
<b>For RI users:</b> This integration will bring the ability to use HAPI's client
|
||||
and server frameworks in your application, as well as the ability to take advantage
|
||||
of HAPI's code-first statically bound extension mechanism.
|
||||
</p>
|
||||
|
||||
<img src="./images/hapi-1.1-structs-resource.png" alt="Structures"/>
|
||||
|
||||
<subsection name="How it Works">
|
||||
<p>
|
||||
At this point, the RI integration consists of a new parallel set of
|
||||
classes representing the FHIR data model. For example, in addition to the
|
||||
Patient classes representing HAPI's DSTU1 and DSTU2 models there is now
|
||||
a new Patient class representing the RI structure (which is also a DSTU2
|
||||
structure).
|
||||
</p>
|
||||
<p>
|
||||
The reference implementation (RI) structures have been added as a new
|
||||
maven dependency library called <code>hapi-fhir-structures-hl7org-dstu2</code>. See
|
||||
the <a href="./download.html">download page</a> for information on the Maven
|
||||
dependencies for this version of the structures.
|
||||
</p>
|
||||
<p>
|
||||
A new interface has been added which serves as a master interface
|
||||
for all resource classes: <code>org.hl7.fhir.instance.model.api.IBaseResource</code>.
|
||||
All RI resource classes will be in the package <code>org.hl7.fhir.instance.model</code>,
|
||||
as shown below.
|
||||
</p>
|
||||
<img src="./images/hapi-1.1-structs-resource.png" alt="Structures"/>
|
||||
|
||||
<p>
|
||||
Datatypes will also be found inthe same package. Unlike HAPI datatype structures,
|
||||
which all end with "Dt", the RI primitive structure names end with "Type" and the
|
||||
RI composite structures have no suffix, as shown below.
|
||||
</p>
|
||||
<img src="./images/hapi-1.1-structs-datatypes.png" alt="Structures"/>
|
||||
|
||||
</subsection>
|
||||
</section>
|
||||
|
||||
<!--
|
||||
|
|
|
@ -91,6 +91,21 @@ compile 'ca.uhn.hapi.fhir:hapi-fhir-structures-dstu:${hapi_stable_version}']]></
|
|||
compile 'ca.uhn.hapi.fhir:hapi-fhir-structures-dstu2:${hapi_stable_version}']]></source>
|
||||
</subsection>
|
||||
|
||||
<subsection name="Using Reference Implementation Structures">
|
||||
|
||||
<p>
|
||||
To use the HL7.org reference implementation structures
|
||||
(see the <a href="./doc_upgrading.html">upgrading page</a> for more information),
|
||||
use the following dependency.
|
||||
</p>
|
||||
<source><![CDATA[<dependency>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-structures-hl7org-dstu2</artifactId>
|
||||
<version>${hapi_stable_version}</version>
|
||||
</dependency>]]></source>
|
||||
|
||||
</subsection>
|
||||
|
||||
</section>
|
||||
|
||||
<section name="Using Snapshot Builds">
|
||||
|
|
Loading…
Reference in New Issue