Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit df64150
Author: James Agnew <jamesagnew@gmail.com>
Date:   Sat Sep 29 13:47:22 2018 -0400

    Shrink validation resources

commit 4c1550e
Author: James Agnew <jamesagnew@gmail.com>
Date:   Fri Sep 28 22:45:28 2018 -0400

    Updates to get R4 working

commit 8332f15
Author: jamesagnew <jamesagnew@gmail.com>
Date:   Fri Sep 28 09:02:13 2018 -0400

    Ongoing work on gettign R4 working

commit f7146ca
Author: James Agnew <jamesagnew@gmail.com>
Date:   Fri Sep 28 05:21:01 2018 -0400

    More work on sync

commit f48de4a
Merge: 9e4f3cc aacb78b
Author: James Agnew <jamesagnew@gmail.com>
Date:   Thu Sep 27 20:11:29 2018 -0400

    Merge branch 'sync_r4' of github.com:jamesagnew/hapi-fhir into sync_r4

commit 9e4f3cc
Author: James Agnew <jamesagnew@gmail.com>
Date:   Thu Sep 27 20:11:19 2018 -0400

    Fix compile error

commit 7ec29e0
Merge: 23f7517 002c4b3
Author: James Agnew <jamesagnew@gmail.com>
Date:   Thu Sep 27 20:04:23 2018 -0400

    Merge branch 'master' into sync_r4

commit aacb78b
Author: jamesagnew <jamesagnew@gmail.com>
Date:   Thu Sep 27 20:01:42 2018 -0400

    Keep working on getting R4 building

commit 4950de4
Author: jamesagnew <jamesagnew@gmail.com>
Date:   Tue Sep 25 13:11:27 2018 -0400

    Ongoing work to get R4 working

commit 819d69c
Author: jamesagnew <jamesagnew@gmail.com>
Date:   Thu Sep 20 08:15:36 2018 -0400

    Work on getting build working

commit 2c61b6c
Merge: 16b5bb0 dfb4de8
Author: jamesagnew <jamesagnew@gmail.com>
Date:   Thu Sep 20 05:16:53 2018 -0400

    Merge branch 'master' into sync_r4

commit 16b5bb0
Author: jamesagnew <jamesagnew@gmail.com>
Date:   Mon Sep 17 05:30:39 2018 -0400

    Work on R4 sync

commit 23f7517
Author: James Agnew <jamesagnew@gmail.com>
Date:   Sun Sep 16 10:19:00 2018 -0400

    Work on sync

commit 6cc413c
Author: James Agnew <jamesagnew@gmail.com>
Date:   Fri Sep 14 17:28:28 2018 -0400

    Work on R$ sync

commit df6f6ad
Author: jamesagnew <jamesagnew@gmail.com>
Date:   Fri Sep 14 08:33:07 2018 -0400

    Work on R4
  • Loading branch information
jamesagnew committed Sep 29, 2018
1 parent 002c4b3 commit 3e445fa
Show file tree
Hide file tree
Showing 2,063 changed files with 1,839,186 additions and 1,643,813 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public ParserOptions setDontStripVersionsFromReferencesAtPaths(Collection<String
} else if (thePaths instanceof HashSet) {
myDontStripVersionsFromReferencesAtPaths = (Set<String>) ((HashSet<String>) thePaths).clone();
} else {
myDontStripVersionsFromReferencesAtPaths = new HashSet<String>(thePaths);
myDontStripVersionsFromReferencesAtPaths = new HashSet<>(thePaths);
}
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,10 @@ public int compare(RuntimeSearchParam theArg0, RuntimeSearchParam theArg1) {
* SPs with the same path the same way. This behaviour is
* used by AuthorizationInterceptor
*/
String nextPath = massagePathForCompartmentSimilarity(next.getPath());
for (RuntimeSearchParam nextAlternate : searchParams) {
if (nextAlternate.getPath().equals(next.getPath())) {
String nextAlternatePath = massagePathForCompartmentSimilarity(nextAlternate.getPath());
if (nextAlternatePath.equals(nextPath)) {
if (!nextAlternate.getName().equals(next.getName())) {
searchParamsForCompartment.add(nextAlternate);
}
Expand Down Expand Up @@ -236,6 +238,14 @@ public int compare(RuntimeSearchParam theArg0, RuntimeSearchParam theArg1) {

}

private String massagePathForCompartmentSimilarity(String thePath) {
String path = thePath;
if (path.matches(".*\\.where\\(resolve\\(\\) is [a-zA-Z]+\\)")) {
path = path.substring(0, path.indexOf(".where"));
}
return path;
}

@Deprecated
public synchronized IBaseResource toProfile() {
validateSealed();
Expand Down
12 changes: 10 additions & 2 deletions hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/BaseParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ protected TagList getMetaTagsForEncoding(IResource theIResource) {
TagList tags = ResourceMetadataKeyEnum.TAG_LIST.get(theIResource);
if (shouldAddSubsettedTag()) {
tags = new TagList(tags);
tags.add(new Tag(Constants.TAG_SUBSETTED_SYSTEM, Constants.TAG_SUBSETTED_CODE, subsetDescription()));
tags.add(new Tag(getSubsettedCodeSystem(), Constants.TAG_SUBSETTED_CODE, subsetDescription()));
}

return tags;
Expand Down Expand Up @@ -746,7 +746,7 @@ protected List<? extends IBase> preProcessValues(BaseRuntimeChildDefinition theM
if (shouldAddSubsettedTag()) {
IBaseCoding coding = metaValue.addTag();
coding.setCode(Constants.TAG_SUBSETTED_CODE);
coding.setSystem(Constants.TAG_SUBSETTED_SYSTEM);
coding.setSystem(getSubsettedCodeSystem());
coding.setDisplay(subsetDescription());
}

Expand Down Expand Up @@ -785,6 +785,14 @@ protected List<? extends IBase> preProcessValues(BaseRuntimeChildDefinition theM
return retVal;
}

private String getSubsettedCodeSystem() {
if (myContext.getVersion().getVersion().isEqualOrNewerThan(FhirVersionEnum.R4)) {
return Constants.TAG_SUBSETTED_SYSTEM_R4;
} else {
return Constants.TAG_SUBSETTED_SYSTEM_DSTU3;
}
}

@Override
public void setDontEncodeElements(Set<String> theDontEncodeElements) {
myDontEncodeElementsIncludesStars = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1286,9 +1286,7 @@ public void attributeValue(String theName, String theValue) throws DataFormatExc
} else {
try {
myInstance.setValueAsString(theValue);
} catch (DataFormatException e) {
myErrorHandler.invalidValue(null, theValue, e.getMessage());
} catch (IllegalArgumentException e) {
} catch (DataFormatException | IllegalArgumentException e) {
myErrorHandler.invalidValue(null, theValue, e.getMessage());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ public class Constants {
public static final int STATUS_HTTP_500_INTERNAL_ERROR = 500;
public static final int STATUS_HTTP_501_NOT_IMPLEMENTED = 501;
public static final String TAG_SUBSETTED_CODE = "SUBSETTED";
public static final String TAG_SUBSETTED_SYSTEM = "http://hl7.org/fhir/v3/ObservationValue";
public static final String TAG_SUBSETTED_SYSTEM_DSTU3 = "http://hl7.org/fhir/v3/ObservationValue";
public static final String TAG_SUBSETTED_SYSTEM_R4 = "http://terminology.hl7.org/CodeSystem/v3-ObservationValue";
public static final String URL_TOKEN_HISTORY = "_history";
public static final String URL_TOKEN_METADATA = "metadata";
public static final String OO_INFOSTATUS_PROCESSING = "processing";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,15 @@ public enum RestSearchParameterTypeEnum {
*/
HAS("string", "http://hl7.org/fhir/search-param-type"),

/**
* Code Value: <b>number</b>
*
* Search parameter SHALL be a number (a whole number, or a decimal).
*/
SPECIAL("special", "http://hl7.org/fhir/search-param-type"),

;


/**
* Identifier for this Value Set:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package ca.uhn.fhir.rest.gclient;

/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 - 2018 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%
*/

import ca.uhn.fhir.rest.api.Constants;
import org.hl7.fhir.instance.model.api.IPrimitiveType;

import java.util.Arrays;
import java.util.List;

/**
*
*/
public class SpecialClientParam extends BaseClientParam implements IParam {

private final String myParamName;

public SpecialClientParam(String theParamName) {
myParamName = theParamName;
}

@Override
public String getParamName() {
return myParamName;
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package ca.uhn.fhir.rest.param;

import ca.uhn.fhir.util.CoverageIgnore;

/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 - 2018 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 class SpecialAndListParam extends BaseAndListParam<SpecialOrListParam> {

@Override
SpecialOrListParam newInstance() {
return new SpecialOrListParam();
}

@CoverageIgnore
@Override
public SpecialAndListParam addAnd(SpecialOrListParam theValue) {
addValue(theValue);
return this;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package ca.uhn.fhir.rest.param;

import ca.uhn.fhir.util.CoverageIgnore;

/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 - 2018 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 class SpecialOrListParam extends BaseOrListParam<SpecialOrListParam, SpecialParam> {

@CoverageIgnore
@Override
SpecialParam newInstance() {
return new SpecialParam();
}

@CoverageIgnore
@Override
public SpecialOrListParam addOr(SpecialParam theParameter) {
add(theParameter);
return this;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
package ca.uhn.fhir.rest.param;

/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 - 2018 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%
*/

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.primitive.UriDt;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import static org.apache.commons.lang3.StringUtils.defaultString;

public class SpecialParam extends BaseParam /*implements IQueryParameterType*/ {

private String myValue;

/**
* Constructor
*/
public SpecialParam() {
super();
}

@Override
String doGetQueryParameterQualifier() {
return null;
}

/**
* {@inheritDoc}
*/
@Override
String doGetValueAsQueryToken(FhirContext theContext) {
return ParameterUtil.escape(getValue());
}

/**
* {@inheritDoc}
*/
@Override
void doSetValueAsQueryToken(FhirContext theContext, String theParamName, String theQualifier, String theParameter) {
setValue(ParameterUtil.unescape(theParameter));
}

/**
* Returns the value for the token (generally the value to the right of the
* vertical bar on the URL)
*/
public String getValue() {
return myValue;
}

public String getValueNotNull() {
return defaultString(myValue);
}

public boolean isEmpty() {
return StringUtils.isEmpty(myValue);
}


public SpecialParam setValue(String theValue) {
myValue = theValue;
return this;
}

@Override
public String toString() {
ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
builder.append("value", getValue());
if (getMissing() != null) {
builder.append(":missing", getMissing());
}
return builder.toString();
}

private static String toSystemValue(UriDt theSystem) {
return theSystem.getValueAsString();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public BaseServerResponseException(int theStatusCode, String theMessage, Throwab
* The underlying cause exception
*/
public BaseServerResponseException(int theStatusCode, Throwable theCause) {
super(theCause.toString(), theCause);
super(theCause.getMessage(), theCause);
myStatusCode = theStatusCode;
myBaseOperationOutcome = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,23 @@ public class InvalidRequestException extends BaseServerResponseException {
public static final int STATUS_CODE = Constants.STATUS_HTTP_400_BAD_REQUEST;
private static final long serialVersionUID = 1L;

/**
* Constructor
*/
public InvalidRequestException(String theMessage) {
super(STATUS_CODE, theMessage);
}

/**
* Constructor
*/
public InvalidRequestException(String theMessage, Throwable theCause) {
super(STATUS_CODE, theMessage, theCause);
}

/**
* Constructor
*/
public InvalidRequestException(Throwable theCause) {
super(STATUS_CODE, theCause);
}
Expand Down
Loading

0 comments on commit 3e445fa

Please sign in to comment.