id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
22,400 | evernote/android-job | library/src/main/java/android/support/v4/app/SafeJobServiceEngineImpl.java | SafeJobServiceEngineImpl.dequeueWork | @Override
public JobIntentService.GenericWorkItem dequeueWork() {
JobWorkItem work = null;
synchronized (mLock) {
if (mParams == null) {
return null;
}
try {
work = mParams.dequeueWork();
} catch (SecurityException se) {... | java | @Override
public JobIntentService.GenericWorkItem dequeueWork() {
JobWorkItem work = null;
synchronized (mLock) {
if (mParams == null) {
return null;
}
try {
work = mParams.dequeueWork();
} catch (SecurityException se) {... | [
"@",
"Override",
"public",
"JobIntentService",
".",
"GenericWorkItem",
"dequeueWork",
"(",
")",
"{",
"JobWorkItem",
"work",
"=",
"null",
";",
"synchronized",
"(",
"mLock",
")",
"{",
"if",
"(",
"mParams",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
... | Dequeue some work. | [
"Dequeue",
"some",
"work",
"."
] | 5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf | https://github.com/evernote/android-job/blob/5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf/library/src/main/java/android/support/v4/app/SafeJobServiceEngineImpl.java#L86-L106 |
22,401 | evernote/android-job | library/src/main/java/com/evernote/android/job/util/JobPreconditions.java | JobPreconditions.checkNotEmpty | public static <T extends CharSequence> T checkNotEmpty(final T reference) {
if (TextUtils.isEmpty(reference)) {
throw new IllegalArgumentException();
}
return reference;
} | java | public static <T extends CharSequence> T checkNotEmpty(final T reference) {
if (TextUtils.isEmpty(reference)) {
throw new IllegalArgumentException();
}
return reference;
} | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"checkNotEmpty",
"(",
"final",
"T",
"reference",
")",
"{",
"if",
"(",
"TextUtils",
".",
"isEmpty",
"(",
"reference",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";"... | Ensures that a CharSequence passed as a parameter to the calling method is
not null and not empty.
@param reference an CharSequence reference
@return the non-empty reference that was validated
@throws IllegalArgumentException if {@code reference} was null or empty | [
"Ensures",
"that",
"a",
"CharSequence",
"passed",
"as",
"a",
"parameter",
"to",
"the",
"calling",
"method",
"is",
"not",
"null",
"and",
"not",
"empty",
"."
] | 5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf | https://github.com/evernote/android-job/blob/5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf/library/src/main/java/com/evernote/android/job/util/JobPreconditions.java#L77-L82 |
22,402 | evernote/android-job | library/src/main/java/com/evernote/android/job/util/JobPreconditions.java | JobPreconditions.checkFlagsArgument | public static void checkFlagsArgument(final int requestedFlags, final int allowedFlags) {
if ((requestedFlags & allowedFlags) != requestedFlags) {
throw new IllegalArgumentException("Requested flags 0x"
+ Integer.toHexString(requestedFlags) + ", but only 0x"
+... | java | public static void checkFlagsArgument(final int requestedFlags, final int allowedFlags) {
if ((requestedFlags & allowedFlags) != requestedFlags) {
throw new IllegalArgumentException("Requested flags 0x"
+ Integer.toHexString(requestedFlags) + ", but only 0x"
+... | [
"public",
"static",
"void",
"checkFlagsArgument",
"(",
"final",
"int",
"requestedFlags",
",",
"final",
"int",
"allowedFlags",
")",
"{",
"if",
"(",
"(",
"requestedFlags",
"&",
"allowedFlags",
")",
"!=",
"requestedFlags",
")",
"{",
"throw",
"new",
"IllegalArgument... | Check the requested flags, throwing if any requested flags are outside
the allowed set. | [
"Check",
"the",
"requested",
"flags",
"throwing",
"if",
"any",
"requested",
"flags",
"are",
"outside",
"the",
"allowed",
"set",
"."
] | 5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf | https://github.com/evernote/android-job/blob/5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf/library/src/main/java/com/evernote/android/job/util/JobPreconditions.java#L101-L107 |
22,403 | evernote/android-job | library/src/main/java/com/evernote/android/job/util/JobPreconditions.java | JobPreconditions.checkArgumentFinite | public static float checkArgumentFinite(final float value, final String valueName) {
if (Float.isNaN(value)) {
throw new IllegalArgumentException(valueName + " must not be NaN");
} else if (Float.isInfinite(value)) {
throw new IllegalArgumentException(valueName + " must not be in... | java | public static float checkArgumentFinite(final float value, final String valueName) {
if (Float.isNaN(value)) {
throw new IllegalArgumentException(valueName + " must not be NaN");
} else if (Float.isInfinite(value)) {
throw new IllegalArgumentException(valueName + " must not be in... | [
"public",
"static",
"float",
"checkArgumentFinite",
"(",
"final",
"float",
"value",
",",
"final",
"String",
"valueName",
")",
"{",
"if",
"(",
"Float",
".",
"isNaN",
"(",
"value",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"valueName",
"+... | Ensures that the argument floating point value is a finite number.
<p>A finite number is defined to be both representable (that is, not NaN) and
not infinite (that is neither positive or negative infinity).</p>
@param value a floating point value
@param valueName the name of the argument to use if the check fails
@r... | [
"Ensures",
"that",
"the",
"argument",
"floating",
"point",
"value",
"is",
"a",
"finite",
"number",
"."
] | 5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf | https://github.com/evernote/android-job/blob/5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf/library/src/main/java/com/evernote/android/job/util/JobPreconditions.java#L186-L194 |
22,404 | evernote/android-job | library/src/main/java/com/evernote/android/job/util/JobPreconditions.java | JobPreconditions.checkArgumentInRange | public static float checkArgumentInRange(float value, float lower, float upper,
String valueName) {
if (Float.isNaN(value)) {
throw new IllegalArgumentException(valueName + " must not be NaN");
} else if (value < lower) {
throw new Ill... | java | public static float checkArgumentInRange(float value, float lower, float upper,
String valueName) {
if (Float.isNaN(value)) {
throw new IllegalArgumentException(valueName + " must not be NaN");
} else if (value < lower) {
throw new Ill... | [
"public",
"static",
"float",
"checkArgumentInRange",
"(",
"float",
"value",
",",
"float",
"lower",
",",
"float",
"upper",
",",
"String",
"valueName",
")",
"{",
"if",
"(",
"Float",
".",
"isNaN",
"(",
"value",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentE... | Ensures that the argument floating point value is within the inclusive range.
<p>While this can be used to range check against +/- infinity, note that all NaN numbers
will always be out of range.</p>
@param value a floating point value
@param lower the lower endpoint of the inclusive range
@param upper the upper endp... | [
"Ensures",
"that",
"the",
"argument",
"floating",
"point",
"value",
"is",
"within",
"the",
"inclusive",
"range",
"."
] | 5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf | https://github.com/evernote/android-job/blob/5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf/library/src/main/java/com/evernote/android/job/util/JobPreconditions.java#L211-L226 |
22,405 | evernote/android-job | library/src/main/java/com/evernote/android/job/JobRequest.java | JobRequest.scheduleAsync | public void scheduleAsync(@NonNull final JobScheduledCallback callback) {
JobPreconditions.checkNotNull(callback);
JobConfig.getExecutorService().execute(new Runnable() {
@Override
public void run() {
try {
int jobId = schedule();
... | java | public void scheduleAsync(@NonNull final JobScheduledCallback callback) {
JobPreconditions.checkNotNull(callback);
JobConfig.getExecutorService().execute(new Runnable() {
@Override
public void run() {
try {
int jobId = schedule();
... | [
"public",
"void",
"scheduleAsync",
"(",
"@",
"NonNull",
"final",
"JobScheduledCallback",
"callback",
")",
"{",
"JobPreconditions",
".",
"checkNotNull",
"(",
"callback",
")",
";",
"JobConfig",
".",
"getExecutorService",
"(",
")",
".",
"execute",
"(",
"new",
"Runn... | Helper method to schedule a request on a background thread. This is helpful to avoid IO operations
on the main thread. The callback notifies you about the job ID or a possible failure.
@param callback The callback which is invoked after the request has been scheduled. | [
"Helper",
"method",
"to",
"schedule",
"a",
"request",
"on",
"a",
"background",
"thread",
".",
"This",
"is",
"helpful",
"to",
"avoid",
"IO",
"operations",
"on",
"the",
"main",
"thread",
".",
"The",
"callback",
"notifies",
"you",
"about",
"the",
"job",
"ID",... | 5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf | https://github.com/evernote/android-job/blob/5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf/library/src/main/java/com/evernote/android/job/JobRequest.java#L453-L466 |
22,406 | evernote/android-job | library/src/main/java/com/evernote/android/job/JobRequest.java | JobRequest.cancelAndEdit | public Builder cancelAndEdit() {
// create a temporary variable, because .cancel() will reset mScheduledAt
long scheduledAt = mScheduledAt;
JobManager.instance().cancel(getJobId());
Builder builder = new Builder(this.mBuilder);
mStarted = false;
if (!isPeriodic()) {
... | java | public Builder cancelAndEdit() {
// create a temporary variable, because .cancel() will reset mScheduledAt
long scheduledAt = mScheduledAt;
JobManager.instance().cancel(getJobId());
Builder builder = new Builder(this.mBuilder);
mStarted = false;
if (!isPeriodic()) {
... | [
"public",
"Builder",
"cancelAndEdit",
"(",
")",
"{",
"// create a temporary variable, because .cancel() will reset mScheduledAt",
"long",
"scheduledAt",
"=",
"mScheduledAt",
";",
"JobManager",
".",
"instance",
"(",
")",
".",
"cancel",
"(",
"getJobId",
"(",
")",
")",
"... | Cancel this request if it has been scheduled. Note that if the job isn't periodic, then the
time passed since the job has been scheduled is subtracted from the time frame. For example
a job should run between 4 and 6 seconds from now. You cancel the scheduled job after 2
seconds, then the job will run between 2 and 4 s... | [
"Cancel",
"this",
"request",
"if",
"it",
"has",
"been",
"scheduled",
".",
"Note",
"that",
"if",
"the",
"job",
"isn",
"t",
"periodic",
"then",
"the",
"time",
"passed",
"since",
"the",
"job",
"has",
"been",
"scheduled",
"is",
"subtracted",
"from",
"the",
"... | 5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf | https://github.com/evernote/android-job/blob/5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf/library/src/main/java/com/evernote/android/job/JobRequest.java#L476-L491 |
22,407 | evernote/android-job | library/src/main/java/com/evernote/android/job/JobConfig.java | JobConfig.setAllowSmallerIntervalsForMarshmallow | public static void setAllowSmallerIntervalsForMarshmallow(boolean allowSmallerIntervals) {
if (allowSmallerIntervals && Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
throw new IllegalStateException("This method is only allowed to call on Android M or earlier");
}
JobConfig.allowS... | java | public static void setAllowSmallerIntervalsForMarshmallow(boolean allowSmallerIntervals) {
if (allowSmallerIntervals && Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
throw new IllegalStateException("This method is only allowed to call on Android M or earlier");
}
JobConfig.allowS... | [
"public",
"static",
"void",
"setAllowSmallerIntervalsForMarshmallow",
"(",
"boolean",
"allowSmallerIntervals",
")",
"{",
"if",
"(",
"allowSmallerIntervals",
"&&",
"Build",
".",
"VERSION",
".",
"SDK_INT",
">=",
"Build",
".",
"VERSION_CODES",
".",
"N",
")",
"{",
"th... | Option to override the minimum period and minimum flex for periodic jobs. This is useful for testing
purposes. This method only works for Android M and earlier. Later versions throw an exception.
@param allowSmallerIntervals Whether a smaller interval and flex than the minimum values are allowed
for periodic jobs are ... | [
"Option",
"to",
"override",
"the",
"minimum",
"period",
"and",
"minimum",
"flex",
"for",
"periodic",
"jobs",
".",
"This",
"is",
"useful",
"for",
"testing",
"purposes",
".",
"This",
"method",
"only",
"works",
"for",
"Android",
"M",
"and",
"earlier",
".",
"L... | 5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf | https://github.com/evernote/android-job/blob/5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf/library/src/main/java/com/evernote/android/job/JobConfig.java#L146-L151 |
22,408 | evernote/android-job | library/src/main/java/com/evernote/android/job/JobConfig.java | JobConfig.setJobIdOffset | public static void setJobIdOffset(int jobIdOffset) {
JobPreconditions.checkArgumentNonnegative(jobIdOffset, "offset can't be negative");
if (jobIdOffset > JobIdsInternal.RESERVED_JOB_ID_RANGE_START - 500) {
throw new IllegalArgumentException("offset is too close to Integer.MAX_VALUE");
... | java | public static void setJobIdOffset(int jobIdOffset) {
JobPreconditions.checkArgumentNonnegative(jobIdOffset, "offset can't be negative");
if (jobIdOffset > JobIdsInternal.RESERVED_JOB_ID_RANGE_START - 500) {
throw new IllegalArgumentException("offset is too close to Integer.MAX_VALUE");
... | [
"public",
"static",
"void",
"setJobIdOffset",
"(",
"int",
"jobIdOffset",
")",
"{",
"JobPreconditions",
".",
"checkArgumentNonnegative",
"(",
"jobIdOffset",
",",
"\"offset can't be negative\"",
")",
";",
"if",
"(",
"jobIdOffset",
">",
"JobIdsInternal",
".",
"RESERVED_J... | Adds an offset to the job IDs. Job IDs are generated and usually start with 1. This offset shifts the
very first job ID.
@param jobIdOffset The offset for the very first job ID. | [
"Adds",
"an",
"offset",
"to",
"the",
"job",
"IDs",
".",
"Job",
"IDs",
"are",
"generated",
"and",
"usually",
"start",
"with",
"1",
".",
"This",
"offset",
"shifts",
"the",
"very",
"first",
"job",
"ID",
"."
] | 5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf | https://github.com/evernote/android-job/blob/5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf/library/src/main/java/com/evernote/android/job/JobConfig.java#L253-L260 |
22,409 | evernote/android-job | library/src/main/java/com/evernote/android/job/JobConfig.java | JobConfig.reset | public static void reset() {
for (JobApi api : JobApi.values()) {
ENABLED_APIS.put(api, Boolean.TRUE);
}
allowSmallerIntervals = false;
forceAllowApi14 = false;
jobReschedulePause = DEFAULT_JOB_RESCHEDULE_PAUSE;
skipJobReschedule = false;
jobIdOffset =... | java | public static void reset() {
for (JobApi api : JobApi.values()) {
ENABLED_APIS.put(api, Boolean.TRUE);
}
allowSmallerIntervals = false;
forceAllowApi14 = false;
jobReschedulePause = DEFAULT_JOB_RESCHEDULE_PAUSE;
skipJobReschedule = false;
jobIdOffset =... | [
"public",
"static",
"void",
"reset",
"(",
")",
"{",
"for",
"(",
"JobApi",
"api",
":",
"JobApi",
".",
"values",
"(",
")",
")",
"{",
"ENABLED_APIS",
".",
"put",
"(",
"api",
",",
"Boolean",
".",
"TRUE",
")",
";",
"}",
"allowSmallerIntervals",
"=",
"fals... | Resets all adjustments in the config. | [
"Resets",
"all",
"adjustments",
"in",
"the",
"config",
"."
] | 5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf | https://github.com/evernote/android-job/blob/5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf/library/src/main/java/com/evernote/android/job/JobConfig.java#L329-L344 |
22,410 | searchbox-io/Jest | jest-common/src/main/java/io/searchbox/action/AbstractMultiIndexActionBuilder.java | AbstractMultiIndexActionBuilder.ignoreUnavailable | public K ignoreUnavailable(boolean ignore) {
setParameter(Parameters.IGNORE_UNAVAILABLE, String.valueOf(ignore));
return (K) this;
} | java | public K ignoreUnavailable(boolean ignore) {
setParameter(Parameters.IGNORE_UNAVAILABLE, String.valueOf(ignore));
return (K) this;
} | [
"public",
"K",
"ignoreUnavailable",
"(",
"boolean",
"ignore",
")",
"{",
"setParameter",
"(",
"Parameters",
".",
"IGNORE_UNAVAILABLE",
",",
"String",
".",
"valueOf",
"(",
"ignore",
")",
")",
";",
"return",
"(",
"K",
")",
"this",
";",
"}"
] | Ignore unavailable indices, this includes indices that not exists or closed indices.
@param ignore whether to ignore unavailable indices | [
"Ignore",
"unavailable",
"indices",
"this",
"includes",
"indices",
"that",
"not",
"exists",
"or",
"closed",
"indices",
"."
] | 42f0a97acc45582baf5e8ecd7ccbbc5ac0c111fc | https://github.com/searchbox-io/Jest/blob/42f0a97acc45582baf5e8ecd7ccbbc5ac0c111fc/jest-common/src/main/java/io/searchbox/action/AbstractMultiIndexActionBuilder.java#L31-L34 |
22,411 | searchbox-io/Jest | jest-common/src/main/java/io/searchbox/action/AbstractMultiIndexActionBuilder.java | AbstractMultiIndexActionBuilder.allowNoIndices | public K allowNoIndices(boolean allow) {
setParameter(Parameters.ALLOW_NO_INDICES, String.valueOf(allow));
return (K) this;
} | java | public K allowNoIndices(boolean allow) {
setParameter(Parameters.ALLOW_NO_INDICES, String.valueOf(allow));
return (K) this;
} | [
"public",
"K",
"allowNoIndices",
"(",
"boolean",
"allow",
")",
"{",
"setParameter",
"(",
"Parameters",
".",
"ALLOW_NO_INDICES",
",",
"String",
".",
"valueOf",
"(",
"allow",
")",
")",
";",
"return",
"(",
"K",
")",
"this",
";",
"}"
] | Fail of wildcard indices expressions results into no concrete indices.
@param allow whether to allow no indices. | [
"Fail",
"of",
"wildcard",
"indices",
"expressions",
"results",
"into",
"no",
"concrete",
"indices",
"."
] | 42f0a97acc45582baf5e8ecd7ccbbc5ac0c111fc | https://github.com/searchbox-io/Jest/blob/42f0a97acc45582baf5e8ecd7ccbbc5ac0c111fc/jest-common/src/main/java/io/searchbox/action/AbstractMultiIndexActionBuilder.java#L40-L43 |
22,412 | searchbox-io/Jest | jest-common/src/main/java/io/searchbox/indices/aliases/AbstractAliasMappingBuilder.java | AbstractAliasMappingBuilder.addRouting | public K addRouting(String routing) {
this.indexRouting.add(routing);
this.searchRouting.add(routing);
return (K) this;
} | java | public K addRouting(String routing) {
this.indexRouting.add(routing);
this.searchRouting.add(routing);
return (K) this;
} | [
"public",
"K",
"addRouting",
"(",
"String",
"routing",
")",
"{",
"this",
".",
"indexRouting",
".",
"add",
"(",
"routing",
")",
";",
"this",
".",
"searchRouting",
".",
"add",
"(",
"routing",
")",
";",
"return",
"(",
"K",
")",
"this",
";",
"}"
] | This method will add the given routing as both search & index routing. | [
"This",
"method",
"will",
"add",
"the",
"given",
"routing",
"as",
"both",
"search",
"&",
"index",
"routing",
"."
] | 42f0a97acc45582baf5e8ecd7ccbbc5ac0c111fc | https://github.com/searchbox-io/Jest/blob/42f0a97acc45582baf5e8ecd7ccbbc5ac0c111fc/jest-common/src/main/java/io/searchbox/indices/aliases/AbstractAliasMappingBuilder.java#L51-L55 |
22,413 | searchbox-io/Jest | jest-common/src/main/java/io/searchbox/indices/aliases/AbstractAliasMappingBuilder.java | AbstractAliasMappingBuilder.addRouting | public K addRouting(List<String> routings) {
this.indexRouting.addAll(routings);
this.searchRouting.addAll(routings);
return (K) this;
} | java | public K addRouting(List<String> routings) {
this.indexRouting.addAll(routings);
this.searchRouting.addAll(routings);
return (K) this;
} | [
"public",
"K",
"addRouting",
"(",
"List",
"<",
"String",
">",
"routings",
")",
"{",
"this",
".",
"indexRouting",
".",
"addAll",
"(",
"routings",
")",
";",
"this",
".",
"searchRouting",
".",
"addAll",
"(",
"routings",
")",
";",
"return",
"(",
"K",
")",
... | This method will add the given routings as both search & index routing. | [
"This",
"method",
"will",
"add",
"the",
"given",
"routings",
"as",
"both",
"search",
"&",
"index",
"routing",
"."
] | 42f0a97acc45582baf5e8ecd7ccbbc5ac0c111fc | https://github.com/searchbox-io/Jest/blob/42f0a97acc45582baf5e8ecd7ccbbc5ac0c111fc/jest-common/src/main/java/io/searchbox/indices/aliases/AbstractAliasMappingBuilder.java#L60-L64 |
22,414 | jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Include.java | Include.getParamType | public String getParamType() {
int firstColon = myValue.indexOf(':');
if (firstColon == -1 || firstColon == myValue.length() - 1) {
return null;
}
return myValue.substring(0, firstColon);
} | java | public String getParamType() {
int firstColon = myValue.indexOf(':');
if (firstColon == -1 || firstColon == myValue.length() - 1) {
return null;
}
return myValue.substring(0, firstColon);
} | [
"public",
"String",
"getParamType",
"(",
")",
"{",
"int",
"firstColon",
"=",
"myValue",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"firstColon",
"==",
"-",
"1",
"||",
"firstColon",
"==",
"myValue",
".",
"length",
"(",
")",
"-",
"1",
")",
"... | Returns the portion of the value before the first colon | [
"Returns",
"the",
"portion",
"of",
"the",
"value",
"before",
"the",
"first",
"colon"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Include.java#L130-L136 |
22,415 | jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Include.java | Include.getParamName | public String getParamName() {
int firstColon = myValue.indexOf(':');
if (firstColon == -1 || firstColon == myValue.length() - 1) {
return null;
}
int secondColon = myValue.indexOf(':', firstColon + 1);
if (secondColon != -1) {
return myValue.substring(firstColon + 1, secondColon);
}
return myValue.... | java | public String getParamName() {
int firstColon = myValue.indexOf(':');
if (firstColon == -1 || firstColon == myValue.length() - 1) {
return null;
}
int secondColon = myValue.indexOf(':', firstColon + 1);
if (secondColon != -1) {
return myValue.substring(firstColon + 1, secondColon);
}
return myValue.... | [
"public",
"String",
"getParamName",
"(",
")",
"{",
"int",
"firstColon",
"=",
"myValue",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"firstColon",
"==",
"-",
"1",
"||",
"firstColon",
"==",
"myValue",
".",
"length",
"(",
")",
"-",
"1",
")",
"... | Returns the portion of the value after the first colon but before the second colon | [
"Returns",
"the",
"portion",
"of",
"the",
"value",
"after",
"the",
"first",
"colon",
"but",
"before",
"the",
"second",
"colon"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Include.java#L141-L151 |
22,416 | jamesagnew/hapi-fhir | hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/impl/FhirServerManager.java | FhirServerManager.unregisterFhirServer | public void unregisterFhirServer (FhirServer server, Map<String,Object> props) throws FhirConfigurationException {
if (server != null) {
String serverName = (String)props.get(FhirServer.SVCPROP_SERVICE_NAME);
if (serverName != null) {
FhirServer service = registeredServers.get(serverName);
if (service !... | java | public void unregisterFhirServer (FhirServer server, Map<String,Object> props) throws FhirConfigurationException {
if (server != null) {
String serverName = (String)props.get(FhirServer.SVCPROP_SERVICE_NAME);
if (serverName != null) {
FhirServer service = registeredServers.get(serverName);
if (service !... | [
"public",
"void",
"unregisterFhirServer",
"(",
"FhirServer",
"server",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"props",
")",
"throws",
"FhirConfigurationException",
"{",
"if",
"(",
"server",
"!=",
"null",
")",
"{",
"String",
"serverName",
"=",
"(",
"S... | This method will be called when a FHIR Server OSGi service
is being removed from the container. This normally will only
occur when its bundle is stopped because it is being removed
or updated.
@param server OSGi service implementing the FhirService interface
@param props the <service-properties> for that service
@thr... | [
"This",
"method",
"will",
"be",
"called",
"when",
"a",
"FHIR",
"Server",
"OSGi",
"service",
"is",
"being",
"removed",
"from",
"the",
"container",
".",
"This",
"normally",
"will",
"only",
"occur",
"when",
"its",
"bundle",
"is",
"stopped",
"because",
"it",
"... | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/impl/FhirServerManager.java#L130-L155 |
22,417 | jamesagnew/hapi-fhir | hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/impl/FhirServerManager.java | FhirServerManager.registerFhirProviders | public void registerFhirProviders (FhirProviderBundle bundle, Map<String,Object> props) throws FhirConfigurationException {
if (bundle != null) {
Collection<Object> providers = bundle.getProviders();
if (providers != null && !providers.isEmpty()) {
try {
String serverName = (String)props.get(FhirServer... | java | public void registerFhirProviders (FhirProviderBundle bundle, Map<String,Object> props) throws FhirConfigurationException {
if (bundle != null) {
Collection<Object> providers = bundle.getProviders();
if (providers != null && !providers.isEmpty()) {
try {
String serverName = (String)props.get(FhirServer... | [
"public",
"void",
"registerFhirProviders",
"(",
"FhirProviderBundle",
"bundle",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"props",
")",
"throws",
"FhirConfigurationException",
"{",
"if",
"(",
"bundle",
"!=",
"null",
")",
"{",
"Collection",
"<",
"Object",
... | Register a new FHIR Provider-Bundle OSGi service.
This could be a "plain" provider that is published with the
FhirProvider interface or it could be a resource provider that
is published with either that same interface or the IResourceProvider
interface.
(That check is not made here but is included as usage documentat... | [
"Register",
"a",
"new",
"FHIR",
"Provider",
"-",
"Bundle",
"OSGi",
"service",
"."
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/impl/FhirServerManager.java#L186-L219 |
22,418 | jamesagnew/hapi-fhir | hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/impl/FhirServerManager.java | FhirServerManager.unregisterFhirProviders | public void unregisterFhirProviders (FhirProviderBundle bundle, Map<String,Object> props) throws FhirConfigurationException {
if (bundle != null) {
Collection<Object> providers = bundle.getProviders();
if (providers != null && !providers.isEmpty()) {
try {
registeredProviders.remove(providers);
St... | java | public void unregisterFhirProviders (FhirProviderBundle bundle, Map<String,Object> props) throws FhirConfigurationException {
if (bundle != null) {
Collection<Object> providers = bundle.getProviders();
if (providers != null && !providers.isEmpty()) {
try {
registeredProviders.remove(providers);
St... | [
"public",
"void",
"unregisterFhirProviders",
"(",
"FhirProviderBundle",
"bundle",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"props",
")",
"throws",
"FhirConfigurationException",
"{",
"if",
"(",
"bundle",
"!=",
"null",
")",
"{",
"Collection",
"<",
"Object",
... | This method will be called when a FHIR Provider OSGi service
is being removed from the container. This normally will only
occur when its bundle is stopped because it is being removed
or updated.
@param server OSGi service implementing one of the provider
interfaces
@param props the <service-properties> for that servic... | [
"This",
"method",
"will",
"be",
"called",
"when",
"a",
"FHIR",
"Provider",
"OSGi",
"service",
"is",
"being",
"removed",
"from",
"the",
"container",
".",
"This",
"normally",
"will",
"only",
"occur",
"when",
"its",
"bundle",
"is",
"stopped",
"because",
"it",
... | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/impl/FhirServerManager.java#L248-L271 |
22,419 | jamesagnew/hapi-fhir | hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/BaseDateTimeType.java | BaseDateTimeType.setPrecision | public void setPrecision(TemporalPrecisionEnum thePrecision) throws DataFormatException {
if (thePrecision == null) {
throw new NullPointerException("Precision may not be null");
}
myPrecision = thePrecision;
updateStringValue();
} | java | public void setPrecision(TemporalPrecisionEnum thePrecision) throws DataFormatException {
if (thePrecision == null) {
throw new NullPointerException("Precision may not be null");
}
myPrecision = thePrecision;
updateStringValue();
} | [
"public",
"void",
"setPrecision",
"(",
"TemporalPrecisionEnum",
"thePrecision",
")",
"throws",
"DataFormatException",
"{",
"if",
"(",
"thePrecision",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Precision may not be null\"",
")",
";",
"}",
... | Sets the precision for this datatype
@throws DataFormatException | [
"Sets",
"the",
"precision",
"for",
"this",
"datatype"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/BaseDateTimeType.java#L587-L593 |
22,420 | jamesagnew/hapi-fhir | hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/BaseDateTimeType.java | BaseDateTimeType.setValue | public void setValue(Date theValue, TemporalPrecisionEnum thePrecision) throws DataFormatException {
if (getTimeZone() == null) {
setTimeZone(TimeZone.getDefault());
}
myPrecision = thePrecision;
myFractionalSeconds = "";
if (theValue != null) {
long millis = theValue.getTime() % 1000;
if (millis < 0... | java | public void setValue(Date theValue, TemporalPrecisionEnum thePrecision) throws DataFormatException {
if (getTimeZone() == null) {
setTimeZone(TimeZone.getDefault());
}
myPrecision = thePrecision;
myFractionalSeconds = "";
if (theValue != null) {
long millis = theValue.getTime() % 1000;
if (millis < 0... | [
"public",
"void",
"setValue",
"(",
"Date",
"theValue",
",",
"TemporalPrecisionEnum",
"thePrecision",
")",
"throws",
"DataFormatException",
"{",
"if",
"(",
"getTimeZone",
"(",
")",
"==",
"null",
")",
"{",
"setTimeZone",
"(",
"TimeZone",
".",
"getDefault",
"(",
... | Sets the value for this type using the given Java Date object as the time, and using the specified precision, as
well as the local timezone as determined by the local operating system. Both of
these properties may be modified in subsequent calls if neccesary.
@param theValue
The date value
@param thePrecision
The prec... | [
"Sets",
"the",
"value",
"for",
"this",
"type",
"using",
"the",
"given",
"Java",
"Date",
"object",
"as",
"the",
"time",
"and",
"using",
"the",
"specified",
"precision",
"as",
"well",
"as",
"the",
"local",
"timezone",
"as",
"determined",
"by",
"the",
"local"... | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/BaseDateTimeType.java#L660-L676 |
22,421 | jamesagnew/hapi-fhir | hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/util/JaxRsResponse.java | JaxRsResponse.getResponseWriter | @Override
public Writer getResponseWriter(int theStatusCode, String theStatusMessage, String theContentType, String theCharset, boolean theRespondGzip)
throws UnsupportedEncodingException, IOException {
return new StringWriter();
} | java | @Override
public Writer getResponseWriter(int theStatusCode, String theStatusMessage, String theContentType, String theCharset, boolean theRespondGzip)
throws UnsupportedEncodingException, IOException {
return new StringWriter();
} | [
"@",
"Override",
"public",
"Writer",
"getResponseWriter",
"(",
"int",
"theStatusCode",
",",
"String",
"theStatusMessage",
",",
"String",
"theContentType",
",",
"String",
"theCharset",
",",
"boolean",
"theRespondGzip",
")",
"throws",
"UnsupportedEncodingException",
",",
... | The response writer is a simple String Writer. All output is configured
by the server. | [
"The",
"response",
"writer",
"is",
"a",
"simple",
"String",
"Writer",
".",
"All",
"output",
"is",
"configured",
"by",
"the",
"server",
"."
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/util/JaxRsResponse.java#L62-L66 |
22,422 | jamesagnew/hapi-fhir | hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/elementmodel/Property.java | Property.isPrimitive | public boolean isPrimitive(String code) {
StructureDefinition sd = context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/"+code);
return sd != null && sd.getKind() == StructureDefinitionKind.PRIMITIVETYPE;
} | java | public boolean isPrimitive(String code) {
StructureDefinition sd = context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/"+code);
return sd != null && sd.getKind() == StructureDefinitionKind.PRIMITIVETYPE;
} | [
"public",
"boolean",
"isPrimitive",
"(",
"String",
"code",
")",
"{",
"StructureDefinition",
"sd",
"=",
"context",
".",
"fetchResource",
"(",
"StructureDefinition",
".",
"class",
",",
"\"http://hl7.org/fhir/StructureDefinition/\"",
"+",
"code",
")",
";",
"return",
"s... | Is the given type a primitive
@param E.g. "integer" | [
"Is",
"the",
"given",
"type",
"a",
"primitive"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/elementmodel/Property.java#L135-L138 |
22,423 | jamesagnew/hapi-fhir | examples/src/main/java/example/ExampleRestfulServlet.java | ExampleRestfulServlet.initialize | @Override
protected void initialize() throws ServletException {
/*
* The servlet defines any number of resource providers, and
* configures itself to use them by calling
* setResourceProviders()
*/
List<IResourceProvider> resourceProviders = new ArrayList<IResourceProvider>();... | java | @Override
protected void initialize() throws ServletException {
/*
* The servlet defines any number of resource providers, and
* configures itself to use them by calling
* setResourceProviders()
*/
List<IResourceProvider> resourceProviders = new ArrayList<IResourceProvider>();... | [
"@",
"Override",
"protected",
"void",
"initialize",
"(",
")",
"throws",
"ServletException",
"{",
"/*\n * The servlet defines any number of resource providers, and\n * configures itself to use them by calling\n * setResourceProviders()\n */",
"List",
"<",
"IResourceP... | The initialize method is automatically called when the servlet is starting up, so it can
be used to configure the servlet to define resource providers, or set up
configuration, interceptors, etc. | [
"The",
"initialize",
"method",
"is",
"automatically",
"called",
"when",
"the",
"servlet",
"is",
"starting",
"up",
"so",
"it",
"can",
"be",
"used",
"to",
"configure",
"the",
"servlet",
"to",
"define",
"resource",
"providers",
"or",
"set",
"up",
"configuration",... | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/examples/src/main/java/example/ExampleRestfulServlet.java#L28-L39 |
22,424 | jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/DecimalDt.java | DecimalDt.round | public void round(int thePrecision) {
if (getValue() != null) {
BigDecimal newValue = getValue().round(new MathContext(thePrecision));
setValue(newValue);
}
} | java | public void round(int thePrecision) {
if (getValue() != null) {
BigDecimal newValue = getValue().round(new MathContext(thePrecision));
setValue(newValue);
}
} | [
"public",
"void",
"round",
"(",
"int",
"thePrecision",
")",
"{",
"if",
"(",
"getValue",
"(",
")",
"!=",
"null",
")",
"{",
"BigDecimal",
"newValue",
"=",
"getValue",
"(",
")",
".",
"round",
"(",
"new",
"MathContext",
"(",
"thePrecision",
")",
")",
";",
... | Rounds the value to the given prevision
@see MathContext#getPrecision() | [
"Rounds",
"the",
"value",
"to",
"the",
"given",
"prevision"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/DecimalDt.java#L116-L121 |
22,425 | jamesagnew/hapi-fhir | hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/utils/ToolingExtensions.java | ToolingExtensions.makeIssueSource | public static Extension makeIssueSource(Source source) {
Extension ex = new Extension();
// todo: write this up and get it published with the pack (and handle the redirect?)
ex.setUrl(ToolingExtensions.EXT_ISSUE_SOURCE);
CodeType c = new CodeType();
c.setValue(source.toString());
ex.setVal... | java | public static Extension makeIssueSource(Source source) {
Extension ex = new Extension();
// todo: write this up and get it published with the pack (and handle the redirect?)
ex.setUrl(ToolingExtensions.EXT_ISSUE_SOURCE);
CodeType c = new CodeType();
c.setValue(source.toString());
ex.setVal... | [
"public",
"static",
"Extension",
"makeIssueSource",
"(",
"Source",
"source",
")",
"{",
"Extension",
"ex",
"=",
"new",
"Extension",
"(",
")",
";",
"// todo: write this up and get it published with the pack (and handle the redirect?)\r",
"ex",
".",
"setUrl",
"(",
"ToolingEx... | specific extension helpers | [
"specific",
"extension",
"helpers"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/utils/ToolingExtensions.java#L102-L110 |
22,426 | jamesagnew/hapi-fhir | hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/subscriber/BaseResourceMessage.java | BaseResourceMessage.copyAdditionalPropertiesFrom | public void copyAdditionalPropertiesFrom(BaseResourceMessage theMsg) {
if (theMsg.myAttributes != null) {
if (myAttributes == null) {
myAttributes = new HashMap<>();
}
myAttributes.putAll(theMsg.myAttributes);
}
} | java | public void copyAdditionalPropertiesFrom(BaseResourceMessage theMsg) {
if (theMsg.myAttributes != null) {
if (myAttributes == null) {
myAttributes = new HashMap<>();
}
myAttributes.putAll(theMsg.myAttributes);
}
} | [
"public",
"void",
"copyAdditionalPropertiesFrom",
"(",
"BaseResourceMessage",
"theMsg",
")",
"{",
"if",
"(",
"theMsg",
".",
"myAttributes",
"!=",
"null",
")",
"{",
"if",
"(",
"myAttributes",
"==",
"null",
")",
"{",
"myAttributes",
"=",
"new",
"HashMap",
"<>",
... | Copies any attributes from the given message into this messsage.
@see #setAttribute(String, String)
@see #getAttribute(String) | [
"Copies",
"any",
"attributes",
"from",
"the",
"given",
"message",
"into",
"this",
"messsage",
"."
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/subscriber/BaseResourceMessage.java#L92-L99 |
22,427 | jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/util/XmlUtil.java | XmlUtil.encode | public static String encode(List<XMLEvent> theEvents) {
try {
StringWriter w = new StringWriter();
XMLEventWriter ew = XmlUtil.createXmlFragmentWriter(w);
for (XMLEvent next : theEvents) {
if (next.isCharacters()) {
ew.add(next);
} else {
ew.add(next);
}
}
ew.close();
return w... | java | public static String encode(List<XMLEvent> theEvents) {
try {
StringWriter w = new StringWriter();
XMLEventWriter ew = XmlUtil.createXmlFragmentWriter(w);
for (XMLEvent next : theEvents) {
if (next.isCharacters()) {
ew.add(next);
} else {
ew.add(next);
}
}
ew.close();
return w... | [
"public",
"static",
"String",
"encode",
"(",
"List",
"<",
"XMLEvent",
">",
"theEvents",
")",
"{",
"try",
"{",
"StringWriter",
"w",
"=",
"new",
"StringWriter",
"(",
")",
";",
"XMLEventWriter",
"ew",
"=",
"XmlUtil",
".",
"createXmlFragmentWriter",
"(",
"w",
... | Encode a set of StAX events into a String | [
"Encode",
"a",
"set",
"of",
"StAX",
"events",
"into",
"a",
"String"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/XmlUtil.java#L1570-L1589 |
22,428 | jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/util/XmlUtil.java | XmlUtil.parse | public static List<XMLEvent> parse(String theValue) {
if (isBlank(theValue)) {
return Collections.emptyList();
}
String val = theValue.trim();
if (!val.startsWith("<")) {
val = XhtmlDt.DIV_OPEN_FIRST + val + "</div>";
}
boolean hasProcessingInstruction = val.startsWith("<?");
if (hasProcessingInstr... | java | public static List<XMLEvent> parse(String theValue) {
if (isBlank(theValue)) {
return Collections.emptyList();
}
String val = theValue.trim();
if (!val.startsWith("<")) {
val = XhtmlDt.DIV_OPEN_FIRST + val + "</div>";
}
boolean hasProcessingInstruction = val.startsWith("<?");
if (hasProcessingInstr... | [
"public",
"static",
"List",
"<",
"XMLEvent",
">",
"parse",
"(",
"String",
"theValue",
")",
"{",
"if",
"(",
"isBlank",
"(",
"theValue",
")",
")",
"{",
"return",
"Collections",
".",
"emptyList",
"(",
")",
";",
"}",
"String",
"val",
"=",
"theValue",
".",
... | Parses an XML string into a set of StAX events | [
"Parses",
"an",
"XML",
"string",
"into",
"a",
"set",
"of",
"StAX",
"events"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/XmlUtil.java#L1714-L1752 |
22,429 | jamesagnew/hapi-fhir | hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseDateTimeType.java | BaseDateTimeType.setOffsetMinutes | public void setOffsetMinutes(int theZoneOffsetMinutes) {
int offsetAbs = Math.abs(theZoneOffsetMinutes);
int mins = offsetAbs % 60;
int hours = offsetAbs / 60;
if (theZoneOffsetMinutes < 0) {
setTimeZone(TimeZone.getTimeZone("GMT-" + hours + ":" + mins));
} else {
setTimeZone(TimeZone.getTimeZone("GMT... | java | public void setOffsetMinutes(int theZoneOffsetMinutes) {
int offsetAbs = Math.abs(theZoneOffsetMinutes);
int mins = offsetAbs % 60;
int hours = offsetAbs / 60;
if (theZoneOffsetMinutes < 0) {
setTimeZone(TimeZone.getTimeZone("GMT-" + hours + ":" + mins));
} else {
setTimeZone(TimeZone.getTimeZone("GMT... | [
"public",
"void",
"setOffsetMinutes",
"(",
"int",
"theZoneOffsetMinutes",
")",
"{",
"int",
"offsetAbs",
"=",
"Math",
".",
"abs",
"(",
"theZoneOffsetMinutes",
")",
";",
"int",
"mins",
"=",
"offsetAbs",
"%",
"60",
";",
"int",
"hours",
"=",
"offsetAbs",
"/",
... | Sets the TimeZone offset in minutes relative to GMT | [
"Sets",
"the",
"TimeZone",
"offset",
"in",
"minutes",
"relative",
"to",
"GMT"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseDateTimeType.java#L516-L527 |
22,430 | jamesagnew/hapi-fhir | hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseDateTimeType.java | BaseDateTimeType.add | public void add(int theField, int theValue) {
switch (theField) {
case Calendar.YEAR:
setValue(DateUtils.addYears(getValue(), theValue), getPrecision());
break;
case Calendar.MONTH:
setValue(DateUtils.addMonths(getValue(), theValue), getPrecision());
break;
case Calendar.DATE:
setValue(DateUtils.... | java | public void add(int theField, int theValue) {
switch (theField) {
case Calendar.YEAR:
setValue(DateUtils.addYears(getValue(), theValue), getPrecision());
break;
case Calendar.MONTH:
setValue(DateUtils.addMonths(getValue(), theValue), getPrecision());
break;
case Calendar.DATE:
setValue(DateUtils.... | [
"public",
"void",
"add",
"(",
"int",
"theField",
",",
"int",
"theValue",
")",
"{",
"switch",
"(",
"theField",
")",
"{",
"case",
"Calendar",
".",
"YEAR",
":",
"setValue",
"(",
"DateUtils",
".",
"addYears",
"(",
"getValue",
"(",
")",
",",
"theValue",
")"... | Adds the given amount to the field specified by theField
@param theField
The field, uses constants from {@link Calendar} such as {@link Calendar#YEAR}
@param theValue
The number to add (or subtract for a negative number) | [
"Adds",
"the",
"given",
"amount",
"to",
"the",
"field",
"specified",
"by",
"theField"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/BaseDateTimeType.java#L544-L570 |
22,431 | jamesagnew/hapi-fhir | examples/src/main/java/example/PagingPatientProvider.java | PagingPatientProvider.search | @Search
public IBundleProvider search(@RequiredParam(name = Patient.SP_FAMILY) StringParam theFamily) {
final InstantDt searchTime = InstantDt.withCurrentTime();
/**
* First, we'll search the database for a set of database row IDs that
* match the given search criteria. That way we can kee... | java | @Search
public IBundleProvider search(@RequiredParam(name = Patient.SP_FAMILY) StringParam theFamily) {
final InstantDt searchTime = InstantDt.withCurrentTime();
/**
* First, we'll search the database for a set of database row IDs that
* match the given search criteria. That way we can kee... | [
"@",
"Search",
"public",
"IBundleProvider",
"search",
"(",
"@",
"RequiredParam",
"(",
"name",
"=",
"Patient",
".",
"SP_FAMILY",
")",
"StringParam",
"theFamily",
")",
"{",
"final",
"InstantDt",
"searchTime",
"=",
"InstantDt",
".",
"withCurrentTime",
"(",
")",
"... | Search for Patient resources matching a given family name | [
"Search",
"for",
"Patient",
"resources",
"matching",
"a",
"given",
"family",
"name"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/examples/src/main/java/example/PagingPatientProvider.java#L23-L69 |
22,432 | jamesagnew/hapi-fhir | hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java | BaseHapiFhirDao.createForcedIdIfNeeded | protected ForcedId createForcedIdIfNeeded(ResourceTable theEntity, IIdType theId, boolean theCreateForPureNumericIds) {
if (theId.isEmpty() == false && theId.hasIdPart() && theEntity.getForcedId() == null) {
if (!theCreateForPureNumericIds && IdHelperService.isValidPid(theId)) {
return null;
}
ForcedId ... | java | protected ForcedId createForcedIdIfNeeded(ResourceTable theEntity, IIdType theId, boolean theCreateForPureNumericIds) {
if (theId.isEmpty() == false && theId.hasIdPart() && theEntity.getForcedId() == null) {
if (!theCreateForPureNumericIds && IdHelperService.isValidPid(theId)) {
return null;
}
ForcedId ... | [
"protected",
"ForcedId",
"createForcedIdIfNeeded",
"(",
"ResourceTable",
"theEntity",
",",
"IIdType",
"theId",
",",
"boolean",
"theCreateForPureNumericIds",
")",
"{",
"if",
"(",
"theId",
".",
"isEmpty",
"(",
")",
"==",
"false",
"&&",
"theId",
".",
"hasIdPart",
"... | Returns the newly created forced ID. If the entity already had a forced ID, or if
none was created, returns null. | [
"Returns",
"the",
"newly",
"created",
"forced",
"ID",
".",
"If",
"the",
"entity",
"already",
"had",
"a",
"forced",
"ID",
"or",
"if",
"none",
"was",
"created",
"returns",
"null",
"."
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java#L193-L208 |
22,433 | jamesagnew/hapi-fhir | hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java | BaseHapiFhirDao.validateResourceForStorage | protected void validateResourceForStorage(T theResource, ResourceTable theEntityToSave) {
Object tag = null;
int totalMetaCount = 0;
if (theResource instanceof IResource) {
IResource res = (IResource) theResource;
TagList tagList = ResourceMetadataKeyEnum.TAG_LIST.get(res);
if (tagList != null) {
t... | java | protected void validateResourceForStorage(T theResource, ResourceTable theEntityToSave) {
Object tag = null;
int totalMetaCount = 0;
if (theResource instanceof IResource) {
IResource res = (IResource) theResource;
TagList tagList = ResourceMetadataKeyEnum.TAG_LIST.get(res);
if (tagList != null) {
t... | [
"protected",
"void",
"validateResourceForStorage",
"(",
"T",
"theResource",
",",
"ResourceTable",
"theEntityToSave",
")",
"{",
"Object",
"tag",
"=",
"null",
";",
"int",
"totalMetaCount",
"=",
"0",
";",
"if",
"(",
"theResource",
"instanceof",
"IResource",
")",
"{... | This method is invoked immediately before storing a new resource, or an update to an existing resource to allow the DAO to ensure that it is valid for persistence. By default, checks for the
"subsetted" tag and rejects resources which have it. Subclasses should call the superclass implementation to preserve this check.... | [
"This",
"method",
"is",
"invoked",
"immediately",
"before",
"storing",
"a",
"new",
"resource",
"or",
"an",
"update",
"to",
"an",
"existing",
"resource",
"to",
"allow",
"the",
"DAO",
"to",
"ensure",
"that",
"it",
"is",
"valid",
"for",
"persistence",
".",
"B... | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java#L1325-L1358 |
22,434 | jamesagnew/hapi-fhir | hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ExtensionHelper.java | ExtensionHelper.setExtension | public static void setExtension(Element element, boolean modifier, String uri, Type value) throws FHIRException {
if (value == null) {
// deleting the extension
if (element instanceof BackboneElement)
for (Extension e : ((BackboneElement) element).getModifierExtension()) {
if (uri.equals(e.g... | java | public static void setExtension(Element element, boolean modifier, String uri, Type value) throws FHIRException {
if (value == null) {
// deleting the extension
if (element instanceof BackboneElement)
for (Extension e : ((BackboneElement) element).getModifierExtension()) {
if (uri.equals(e.g... | [
"public",
"static",
"void",
"setExtension",
"(",
"Element",
"element",
",",
"boolean",
"modifier",
",",
"String",
"uri",
",",
"Type",
"value",
")",
"throws",
"FHIRException",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"// deleting the extension\r",
"if",... | set the value of an extension on the element. if value == null, make sure it doesn't exist
@param element - the element to act on. Can also be a backbone element
@param modifier - whether this is a modifier. Note that this is a definitional property of the extension; don't alternate
@param uri - the identifier for the... | [
"set",
"the",
"value",
"of",
"an",
"extension",
"on",
"the",
"element",
".",
"if",
"value",
"==",
"null",
"make",
"sure",
"it",
"doesn",
"t",
"exist"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ExtensionHelper.java#L93-L138 |
22,435 | jamesagnew/hapi-fhir | hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/AbstractJaxRsProvider.java | AbstractJaxRsProvider.getBaseForServer | public String getBaseForServer() {
final String url = getUriInfo().getBaseUri().toASCIIString();
return StringUtils.isNotBlank(url) && url.endsWith("/") ? url.substring(0, url.length() - 1) : url;
} | java | public String getBaseForServer() {
final String url = getUriInfo().getBaseUri().toASCIIString();
return StringUtils.isNotBlank(url) && url.endsWith("/") ? url.substring(0, url.length() - 1) : url;
} | [
"public",
"String",
"getBaseForServer",
"(",
")",
"{",
"final",
"String",
"url",
"=",
"getUriInfo",
"(",
")",
".",
"getBaseUri",
"(",
")",
".",
"toASCIIString",
"(",
")",
";",
"return",
"StringUtils",
".",
"isNotBlank",
"(",
"url",
")",
"&&",
"url",
".",... | This method returns the server base, independent of the request or resource.
@see javax.ws.rs.core.UriInfo#getBaseUri()
@return the ascii string for the server base | [
"This",
"method",
"returns",
"the",
"server",
"base",
"independent",
"of",
"the",
"request",
"or",
"resource",
"."
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/AbstractJaxRsProvider.java#L107-L110 |
22,436 | jamesagnew/hapi-fhir | hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/AbstractJaxRsProvider.java | AbstractJaxRsProvider.getParameters | public Map<String, String[]> getParameters() {
final MultivaluedMap<String, String> queryParameters = getUriInfo().getQueryParameters();
final HashMap<String, String[]> params = new HashMap<String, String[]>();
for (final Entry<String, List<String>> paramEntry : queryParameters.entrySet()) {
params.put(paramEn... | java | public Map<String, String[]> getParameters() {
final MultivaluedMap<String, String> queryParameters = getUriInfo().getQueryParameters();
final HashMap<String, String[]> params = new HashMap<String, String[]>();
for (final Entry<String, List<String>> paramEntry : queryParameters.entrySet()) {
params.put(paramEn... | [
"public",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"getParameters",
"(",
")",
"{",
"final",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"queryParameters",
"=",
"getUriInfo",
"(",
")",
".",
"getQueryParameters",
"(",
")",
";",
"final",
... | This method returns the query parameters
@return the query parameters | [
"This",
"method",
"returns",
"the",
"query",
"parameters"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/AbstractJaxRsProvider.java#L174-L181 |
22,437 | jamesagnew/hapi-fhir | hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/AbstractJaxRsProvider.java | AbstractJaxRsProvider.handleException | public Response handleException(final JaxRsRequest theRequest, final Throwable theException)
throws IOException {
if (theException instanceof JaxRsResponseException) {
return new JaxRsExceptionInterceptor().convertExceptionIntoResponse(theRequest, (JaxRsResponseException) theException);
} else {
return new... | java | public Response handleException(final JaxRsRequest theRequest, final Throwable theException)
throws IOException {
if (theException instanceof JaxRsResponseException) {
return new JaxRsExceptionInterceptor().convertExceptionIntoResponse(theRequest, (JaxRsResponseException) theException);
} else {
return new... | [
"public",
"Response",
"handleException",
"(",
"final",
"JaxRsRequest",
"theRequest",
",",
"final",
"Throwable",
"theException",
")",
"throws",
"IOException",
"{",
"if",
"(",
"theException",
"instanceof",
"JaxRsResponseException",
")",
"{",
"return",
"new",
"JaxRsExcep... | Convert an exception to a response
@param theRequest
the incoming request
@param theException
the exception to convert
@return response
@throws IOException | [
"Convert",
"an",
"exception",
"to",
"a",
"response"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/AbstractJaxRsProvider.java#L242-L250 |
22,438 | jamesagnew/hapi-fhir | hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/cache/SubscriptionLoader.java | SubscriptionLoader.syncSubscriptions | @SuppressWarnings("unused")
@Scheduled(fixedDelay = DateUtils.MILLIS_PER_MINUTE)
public void syncSubscriptions() {
if (!mySyncSubscriptionsSemaphore.tryAcquire()) {
return;
}
try {
doSyncSubscriptionsWithRetry();
} finally {
mySyncSubscriptionsSemaphore.release();
}
} | java | @SuppressWarnings("unused")
@Scheduled(fixedDelay = DateUtils.MILLIS_PER_MINUTE)
public void syncSubscriptions() {
if (!mySyncSubscriptionsSemaphore.tryAcquire()) {
return;
}
try {
doSyncSubscriptionsWithRetry();
} finally {
mySyncSubscriptionsSemaphore.release();
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"@",
"Scheduled",
"(",
"fixedDelay",
"=",
"DateUtils",
".",
"MILLIS_PER_MINUTE",
")",
"public",
"void",
"syncSubscriptions",
"(",
")",
"{",
"if",
"(",
"!",
"mySyncSubscriptionsSemaphore",
".",
"tryAcquire",
"(",
"... | Read the existing subscriptions from the database | [
"Read",
"the",
"existing",
"subscriptions",
"from",
"the",
"database"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/cache/SubscriptionLoader.java#L62-L73 |
22,439 | jamesagnew/hapi-fhir | hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/CircularQueueCaptureQueriesListener.java | CircularQueueCaptureQueriesListener.getCapturedQueries | @SuppressWarnings("UseBulkOperation")
public List<Query> getCapturedQueries() {
// Make a copy so that we aren't affected by changes to the list outside of the
// synchronized block
ArrayList<Query> retVal = new ArrayList<>(CAPACITY);
myQueries.forEach(retVal::add);
return Collections.unmodifiableList(retVal... | java | @SuppressWarnings("UseBulkOperation")
public List<Query> getCapturedQueries() {
// Make a copy so that we aren't affected by changes to the list outside of the
// synchronized block
ArrayList<Query> retVal = new ArrayList<>(CAPACITY);
myQueries.forEach(retVal::add);
return Collections.unmodifiableList(retVal... | [
"@",
"SuppressWarnings",
"(",
"\"UseBulkOperation\"",
")",
"public",
"List",
"<",
"Query",
">",
"getCapturedQueries",
"(",
")",
"{",
"// Make a copy so that we aren't affected by changes to the list outside of the",
"// synchronized block",
"ArrayList",
"<",
"Query",
">",
"re... | Index 0 is oldest | [
"Index",
"0",
"is",
"oldest"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/CircularQueueCaptureQueriesListener.java#L65-L72 |
22,440 | jamesagnew/hapi-fhir | hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/CircularQueueCaptureQueriesListener.java | CircularQueueCaptureQueriesListener.logUpdateQueriesForCurrentThread | public void logUpdateQueriesForCurrentThread() {
List<String> queries = getUpdateQueriesForCurrentThread()
.stream()
.map(CircularQueueCaptureQueriesListener::formatQueryAsSql)
.collect(Collectors.toList());
ourLog.info("Select Queries:\n{}", String.join("\n", queries));
} | java | public void logUpdateQueriesForCurrentThread() {
List<String> queries = getUpdateQueriesForCurrentThread()
.stream()
.map(CircularQueueCaptureQueriesListener::formatQueryAsSql)
.collect(Collectors.toList());
ourLog.info("Select Queries:\n{}", String.join("\n", queries));
} | [
"public",
"void",
"logUpdateQueriesForCurrentThread",
"(",
")",
"{",
"List",
"<",
"String",
">",
"queries",
"=",
"getUpdateQueriesForCurrentThread",
"(",
")",
".",
"stream",
"(",
")",
".",
"map",
"(",
"CircularQueueCaptureQueriesListener",
"::",
"formatQueryAsSql",
... | Log all captured UPDATE queries | [
"Log",
"all",
"captured",
"UPDATE",
"queries"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/CircularQueueCaptureQueriesListener.java#L150-L156 |
22,441 | jamesagnew/hapi-fhir | hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/CircularQueueCaptureQueriesListener.java | CircularQueueCaptureQueriesListener.logFirstSelectQueryForCurrentThread | public void logFirstSelectQueryForCurrentThread() {
String firstSelectQuery = getSelectQueriesForCurrentThread()
.stream()
.findFirst()
.map(CircularQueueCaptureQueriesListener::formatQueryAsSql)
.orElse("NONE FOUND");
ourLog.info("First select Query:\n{}", firstSelectQuery);
} | java | public void logFirstSelectQueryForCurrentThread() {
String firstSelectQuery = getSelectQueriesForCurrentThread()
.stream()
.findFirst()
.map(CircularQueueCaptureQueriesListener::formatQueryAsSql)
.orElse("NONE FOUND");
ourLog.info("First select Query:\n{}", firstSelectQuery);
} | [
"public",
"void",
"logFirstSelectQueryForCurrentThread",
"(",
")",
"{",
"String",
"firstSelectQuery",
"=",
"getSelectQueriesForCurrentThread",
"(",
")",
".",
"stream",
"(",
")",
".",
"findFirst",
"(",
")",
".",
"map",
"(",
"CircularQueueCaptureQueriesListener",
"::",
... | Log first captured SELECT query | [
"Log",
"first",
"captured",
"SELECT",
"query"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/CircularQueueCaptureQueriesListener.java#L183-L190 |
22,442 | jamesagnew/hapi-fhir | hapi-fhir-jpaserver-example/src/main/java/ca/uhn/fhir/jpa/demo/FhirServerConfigDstu2.java | FhirServerConfigDstu2.loggingInterceptor | public IServerInterceptor loggingInterceptor() {
LoggingInterceptor retVal = new LoggingInterceptor();
retVal.setLoggerName("fhirtest.access");
retVal.setMessageFormat(
"Path[${servletPath}] Source[${requestHeader.x-forwarded-for}] Operation[${operationType} ${operationName} ${idOrResourceName}] UA[${requestH... | java | public IServerInterceptor loggingInterceptor() {
LoggingInterceptor retVal = new LoggingInterceptor();
retVal.setLoggerName("fhirtest.access");
retVal.setMessageFormat(
"Path[${servletPath}] Source[${requestHeader.x-forwarded-for}] Operation[${operationType} ${operationName} ${idOrResourceName}] UA[${requestH... | [
"public",
"IServerInterceptor",
"loggingInterceptor",
"(",
")",
"{",
"LoggingInterceptor",
"retVal",
"=",
"new",
"LoggingInterceptor",
"(",
")",
";",
"retVal",
".",
"setLoggerName",
"(",
"\"fhirtest.access\"",
")",
";",
"retVal",
".",
"setMessageFormat",
"(",
"\"Pat... | Do some fancy logging to create a nice access log that has details about each incoming request. | [
"Do",
"some",
"fancy",
"logging",
"to",
"create",
"a",
"nice",
"access",
"log",
"that",
"has",
"details",
"about",
"each",
"incoming",
"request",
"."
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jpaserver-example/src/main/java/ca/uhn/fhir/jpa/demo/FhirServerConfigDstu2.java#L93-L101 |
22,443 | jamesagnew/hapi-fhir | hapi-fhir-jpaserver-example/src/main/java/ca/uhn/fhir/jpa/demo/FhirServerConfigDstu2.java | FhirServerConfigDstu2.responseHighlighterInterceptor | @Bean(autowire = Autowire.BY_TYPE)
public IServerInterceptor responseHighlighterInterceptor() {
ResponseHighlighterInterceptor retVal = new ResponseHighlighterInterceptor();
return retVal;
} | java | @Bean(autowire = Autowire.BY_TYPE)
public IServerInterceptor responseHighlighterInterceptor() {
ResponseHighlighterInterceptor retVal = new ResponseHighlighterInterceptor();
return retVal;
} | [
"@",
"Bean",
"(",
"autowire",
"=",
"Autowire",
".",
"BY_TYPE",
")",
"public",
"IServerInterceptor",
"responseHighlighterInterceptor",
"(",
")",
"{",
"ResponseHighlighterInterceptor",
"retVal",
"=",
"new",
"ResponseHighlighterInterceptor",
"(",
")",
";",
"return",
"ret... | This interceptor adds some pretty syntax highlighting in responses when a browser is detected | [
"This",
"interceptor",
"adds",
"some",
"pretty",
"syntax",
"highlighting",
"in",
"responses",
"when",
"a",
"browser",
"is",
"detected"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jpaserver-example/src/main/java/ca/uhn/fhir/jpa/demo/FhirServerConfigDstu2.java#L106-L110 |
22,444 | jamesagnew/hapi-fhir | hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/LValue.java | LValue.asBoolean | public boolean asBoolean(Object value) {
if (value == null) {
return false;
}
if (value instanceof Boolean) {
return (Boolean) value;
}
return true;
} | java | public boolean asBoolean(Object value) {
if (value == null) {
return false;
}
if (value instanceof Boolean) {
return (Boolean) value;
}
return true;
} | [
"public",
"boolean",
"asBoolean",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"value",
"instanceof",
"Boolean",
")",
"{",
"return",
"(",
"Boolean",
")",
"value",
";",
"}",
"ret... | Convert `value` to a boolean. Note that only `nil` and `false`
are `false`, all other values are `true`.
@param value
the value to convert.
@return `value` as a boolean. | [
"Convert",
"value",
"to",
"a",
"boolean",
".",
"Note",
"that",
"only",
"nil",
"and",
"false",
"are",
"false",
"all",
"other",
"values",
"are",
"true",
"."
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/LValue.java#L113-L124 |
22,445 | jamesagnew/hapi-fhir | hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/LValue.java | LValue.asNumber | public Number asNumber(Object value) throws NumberFormatException {
if(value instanceof Number) {
return (Number) value;
}
String str = String.valueOf(value);
return str.matches("\\d+") ? Long.valueOf(str) : Double.valueOf(str);
} | java | public Number asNumber(Object value) throws NumberFormatException {
if(value instanceof Number) {
return (Number) value;
}
String str = String.valueOf(value);
return str.matches("\\d+") ? Long.valueOf(str) : Double.valueOf(str);
} | [
"public",
"Number",
"asNumber",
"(",
"Object",
"value",
")",
"throws",
"NumberFormatException",
"{",
"if",
"(",
"value",
"instanceof",
"Number",
")",
"{",
"return",
"(",
"Number",
")",
"value",
";",
"}",
"String",
"str",
"=",
"String",
".",
"valueOf",
"(",... | Returns `value` as a Number. Strings will be coerced into
either a Long or Double.
@param value
the value to cast to a Number.
@return `value` as a Number.
@throws NumberFormatException when `value` is a String which could
not be parsed as a Long or Double. | [
"Returns",
"value",
"as",
"a",
"Number",
".",
"Strings",
"will",
"be",
"coerced",
"into",
"either",
"a",
"Long",
"or",
"Double",
"."
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/LValue.java#L138-L147 |
22,446 | jamesagnew/hapi-fhir | hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/LValue.java | LValue.asString | public String asString(Object value) {
if (value == null) {
return "";
}
if (!this.isArray(value)) {
return String.valueOf(value);
}
Object[] array = this.asArray(value);
StringBuilder builder = new StringBuilder();
for (Object obj : a... | java | public String asString(Object value) {
if (value == null) {
return "";
}
if (!this.isArray(value)) {
return String.valueOf(value);
}
Object[] array = this.asArray(value);
StringBuilder builder = new StringBuilder();
for (Object obj : a... | [
"public",
"String",
"asString",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"if",
"(",
"!",
"this",
".",
"isArray",
"(",
"value",
")",
")",
"{",
"return",
"String",
".",
"valueOf",
"(",
... | Returns `value` as a String.
@param value
the value to convert to a String.
@return `value` as a String. | [
"Returns",
"value",
"as",
"a",
"String",
"."
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/LValue.java#L157-L176 |
22,447 | jamesagnew/hapi-fhir | hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/LValue.java | LValue.isArray | public boolean isArray(Object value) {
return value != null && (value.getClass().isArray() || value instanceof List);
} | java | public boolean isArray(Object value) {
return value != null && (value.getClass().isArray() || value instanceof List);
} | [
"public",
"boolean",
"isArray",
"(",
"Object",
"value",
")",
"{",
"return",
"value",
"!=",
"null",
"&&",
"(",
"value",
".",
"getClass",
"(",
")",
".",
"isArray",
"(",
")",
"||",
"value",
"instanceof",
"List",
")",
";",
"}"
] | Returns true iff `value` is an array or a java.util.List.
@param value
the value to check.
@return true iff `value` is an array or a java.util.List. | [
"Returns",
"true",
"iff",
"value",
"is",
"an",
"array",
"or",
"a",
"java",
".",
"util",
".",
"List",
"."
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/LValue.java#L186-L189 |
22,448 | jamesagnew/hapi-fhir | hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/LValue.java | LValue.isNumber | public boolean isNumber(Object value) {
if(value == null) {
return false;
}
if(value instanceof Number) {
return true;
}
// valid Long?
if(String.valueOf(value).matches("\\d+")) {
return true;
}
try {
// ... | java | public boolean isNumber(Object value) {
if(value == null) {
return false;
}
if(value instanceof Number) {
return true;
}
// valid Long?
if(String.valueOf(value).matches("\\d+")) {
return true;
}
try {
// ... | [
"public",
"boolean",
"isNumber",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"value",
"instanceof",
"Number",
")",
"{",
"return",
"true",
";",
"}",
"// valid Long?",
"if",
"(",
... | Returns true iff `value` is a Number.
@param value
the value to check.
@return true iff `value` is a Number. | [
"Returns",
"true",
"iff",
"value",
"is",
"a",
"Number",
"."
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/LValue.java#L211-L234 |
22,449 | jamesagnew/hapi-fhir | example-projects/hapi-fhir-jaxrs-sse/src/main/java/embedded/example/JaxRsPatientProvider.java | JaxRsPatientProvider.storePatient | private void storePatient(final Patient patient) {
try {
patients.put(patient.getIdentifierFirstRep().getValue(), patient);
// if storing is successful the notify the listeners that listens on
// any patient => patient/*
final String bundleToString = currentPatientsAsJsonString();
broadcaster
.... | java | private void storePatient(final Patient patient) {
try {
patients.put(patient.getIdentifierFirstRep().getValue(), patient);
// if storing is successful the notify the listeners that listens on
// any patient => patient/*
final String bundleToString = currentPatientsAsJsonString();
broadcaster
.... | [
"private",
"void",
"storePatient",
"(",
"final",
"Patient",
"patient",
")",
"{",
"try",
"{",
"patients",
".",
"put",
"(",
"patient",
".",
"getIdentifierFirstRep",
"(",
")",
".",
"getValue",
"(",
")",
",",
"patient",
")",
";",
"// if storing is successful the n... | Conceptual wrapper for storing in a db | [
"Conceptual",
"wrapper",
"for",
"storing",
"in",
"a",
"db"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/example-projects/hapi-fhir-jaxrs-sse/src/main/java/embedded/example/JaxRsPatientProvider.java#L79-L95 |
22,450 | jamesagnew/hapi-fhir | hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/utils/Translations.java | Translations.load | public void load(String filename) throws FileNotFoundException, SAXException, IOException, ParserConfigurationException {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
loadMessages(builder.parse(new CSFileInputStream(filenam... | java | public void load(String filename) throws FileNotFoundException, SAXException, IOException, ParserConfigurationException {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
loadMessages(builder.parse(new CSFileInputStream(filenam... | [
"public",
"void",
"load",
"(",
"String",
"filename",
")",
"throws",
"FileNotFoundException",
",",
"SAXException",
",",
"IOException",
",",
"ParserConfigurationException",
"{",
"DocumentBuilderFactory",
"factory",
"=",
"DocumentBuilderFactory",
".",
"newInstance",
"(",
"... | Load from the XML translations file maintained by the FHIR project
@param filename
@throws IOException
@throws SAXException
@throws FileNotFoundException
@throws ParserConfigurationException
@throws Exception | [
"Load",
"from",
"the",
"XML",
"translations",
"file",
"maintained",
"by",
"the",
"FHIR",
"project"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/utils/Translations.java#L42-L46 |
22,451 | jamesagnew/hapi-fhir | hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/utils/Translations.java | Translations.getMessage | public String getMessage(String id, String defaultMsg) {
return getMessage(id, lang, defaultMsg);
} | java | public String getMessage(String id, String defaultMsg) {
return getMessage(id, lang, defaultMsg);
} | [
"public",
"String",
"getMessage",
"(",
"String",
"id",
",",
"String",
"defaultMsg",
")",
"{",
"return",
"getMessage",
"(",
"id",
",",
"lang",
",",
"defaultMsg",
")",
";",
"}"
] | use configured language
@param id - the id of the message to retrieve
@param defaultMsg - string to use if the message is not defined or a language match is not found (if null, then will default to english)
@return the message | [
"use",
"configured",
"language"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/utils/Translations.java#L68-L70 |
22,452 | jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/util/FhirTerser.java | FhirTerser.cloneInto | public IBase cloneInto(IBase theSource, IBase theTarget, boolean theIgnoreMissingFields) {
Validate.notNull(theSource, "theSource must not be null");
Validate.notNull(theTarget, "theTarget must not be null");
if (theSource instanceof IPrimitiveType<?>) {
if (theTarget instanceof IPrimitiveType<?>) {
((IPr... | java | public IBase cloneInto(IBase theSource, IBase theTarget, boolean theIgnoreMissingFields) {
Validate.notNull(theSource, "theSource must not be null");
Validate.notNull(theTarget, "theTarget must not be null");
if (theSource instanceof IPrimitiveType<?>) {
if (theTarget instanceof IPrimitiveType<?>) {
((IPr... | [
"public",
"IBase",
"cloneInto",
"(",
"IBase",
"theSource",
",",
"IBase",
"theTarget",
",",
"boolean",
"theIgnoreMissingFields",
")",
"{",
"Validate",
".",
"notNull",
"(",
"theSource",
",",
"\"theSource must not be null\"",
")",
";",
"Validate",
".",
"notNull",
"("... | Clones all values from a source object into the equivalent fields in a target object
@param theSource The source object (must not be null)
@param theTarget The target object to copy values into (must not be null)
@param theIgnoreMissingFields The ignore fields in the target which do not exist... | [
"Clones",
"all",
"values",
"from",
"a",
"source",
"object",
"into",
"the",
"equivalent",
"fields",
"in",
"a",
"target",
"object"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/FhirTerser.java#L105-L147 |
22,453 | jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/util/FhirTerser.java | FhirTerser.visit | public void visit(IBaseResource theResource, IModelVisitor theVisitor) {
BaseRuntimeElementCompositeDefinition<?> def = myContext.getResourceDefinition(theResource);
visit(new IdentityHashMap<Object, Object>(), theResource, theResource, null, null, def, theVisitor);
} | java | public void visit(IBaseResource theResource, IModelVisitor theVisitor) {
BaseRuntimeElementCompositeDefinition<?> def = myContext.getResourceDefinition(theResource);
visit(new IdentityHashMap<Object, Object>(), theResource, theResource, null, null, def, theVisitor);
} | [
"public",
"void",
"visit",
"(",
"IBaseResource",
"theResource",
",",
"IModelVisitor",
"theVisitor",
")",
"{",
"BaseRuntimeElementCompositeDefinition",
"<",
"?",
">",
"def",
"=",
"myContext",
".",
"getResourceDefinition",
"(",
"theResource",
")",
";",
"visit",
"(",
... | Visit all elements in a given resource
<p>
Note on scope: This method will descend into any contained resources ({@link IResource#getContained()}) as well, but will not descend into linked resources (e.g.
{@link BaseResourceReferenceDt#getResource()}) or embedded resources (e.g. Bundle.entry.resource)
</p>
@param the... | [
"Visit",
"all",
"elements",
"in",
"a",
"given",
"resource"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/FhirTerser.java#L813-L816 |
22,454 | jamesagnew/hapi-fhir | hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/matcher/CriteriaResourceMatcher.java | CriteriaResourceMatcher.match | public SubscriptionMatchResult match(String theCriteria, IBaseResource theResource, ResourceIndexedSearchParams theSearchParams) {
RuntimeResourceDefinition resourceDefinition;
if (theResource == null) {
resourceDefinition = UrlUtil.parseUrlResourceType(myFhirContext, theCriteria);
} else {
resourceDefiniti... | java | public SubscriptionMatchResult match(String theCriteria, IBaseResource theResource, ResourceIndexedSearchParams theSearchParams) {
RuntimeResourceDefinition resourceDefinition;
if (theResource == null) {
resourceDefinition = UrlUtil.parseUrlResourceType(myFhirContext, theCriteria);
} else {
resourceDefiniti... | [
"public",
"SubscriptionMatchResult",
"match",
"(",
"String",
"theCriteria",
",",
"IBaseResource",
"theResource",
",",
"ResourceIndexedSearchParams",
"theSearchParams",
")",
"{",
"RuntimeResourceDefinition",
"resourceDefinition",
";",
"if",
"(",
"theResource",
"==",
"null",
... | This method is called in two different scenarios. With a null theResource, it determines whether database matching might be required.
Otherwise, it tries to perform the match in-memory, returning UNSUPPORTED if it's not possible.
Note that there will be cases where it returns UNSUPPORTED with a null resource, but whe... | [
"This",
"method",
"is",
"called",
"in",
"two",
"different",
"scenarios",
".",
"With",
"a",
"null",
"theResource",
"it",
"determines",
"whether",
"database",
"matching",
"might",
"be",
"required",
".",
"Otherwise",
"it",
"tries",
"to",
"perform",
"the",
"match"... | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/matcher/CriteriaResourceMatcher.java#L67-L94 |
22,455 | jamesagnew/hapi-fhir | hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/FhirServerImpl.java | FhirServerImpl.registerOsgiProvider | @Override
public void registerOsgiProvider (Object provider) throws FhirConfigurationException {
if (null == provider) {
throw new NullPointerException("FHIR Provider cannot be null");
}
try {
super.registerProvider(provider);
log.trace("registered provider. class ["+provider.getClass().getName()+"]");
... | java | @Override
public void registerOsgiProvider (Object provider) throws FhirConfigurationException {
if (null == provider) {
throw new NullPointerException("FHIR Provider cannot be null");
}
try {
super.registerProvider(provider);
log.trace("registered provider. class ["+provider.getClass().getName()+"]");
... | [
"@",
"Override",
"public",
"void",
"registerOsgiProvider",
"(",
"Object",
"provider",
")",
"throws",
"FhirConfigurationException",
"{",
"if",
"(",
"null",
"==",
"provider",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"FHIR Provider cannot be null\"",
")",... | Dynamically registers a single provider with the RestfulServer
@param provider the provider to be registered
@throws FhirConfigurationException | [
"Dynamically",
"registers",
"a",
"single",
"provider",
"with",
"the",
"RestfulServer"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/FhirServerImpl.java#L60-L73 |
22,456 | jamesagnew/hapi-fhir | hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/FhirServerImpl.java | FhirServerImpl.unregisterOsgiProvider | @Override
public void unregisterOsgiProvider (Object provider) throws FhirConfigurationException {
if (null == provider) {
throw new NullPointerException("FHIR Provider cannot be null");
}
try {
this.serverProviders.remove(provider);
log.trace("unregistered provider. class ["+provider.getClass().getName... | java | @Override
public void unregisterOsgiProvider (Object provider) throws FhirConfigurationException {
if (null == provider) {
throw new NullPointerException("FHIR Provider cannot be null");
}
try {
this.serverProviders.remove(provider);
log.trace("unregistered provider. class ["+provider.getClass().getName... | [
"@",
"Override",
"public",
"void",
"unregisterOsgiProvider",
"(",
"Object",
"provider",
")",
"throws",
"FhirConfigurationException",
"{",
"if",
"(",
"null",
"==",
"provider",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"FHIR Provider cannot be null\"",
")... | Dynamically unregisters a single provider with the RestfulServer
@param provider the provider to be unregistered
@throws FhirConfigurationException | [
"Dynamically",
"unregisters",
"a",
"single",
"provider",
"with",
"the",
"RestfulServer"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/FhirServerImpl.java#L81-L94 |
22,457 | jamesagnew/hapi-fhir | hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/FhirServerImpl.java | FhirServerImpl.registerOsgiProviders | @Override
public void registerOsgiProviders (Collection<Object> providers) throws FhirConfigurationException {
if (null == providers) {
throw new NullPointerException("FHIR Provider list cannot be null");
}
try {
super.registerProviders(providers);
for (Object provider : providers) {
log.trace("regi... | java | @Override
public void registerOsgiProviders (Collection<Object> providers) throws FhirConfigurationException {
if (null == providers) {
throw new NullPointerException("FHIR Provider list cannot be null");
}
try {
super.registerProviders(providers);
for (Object provider : providers) {
log.trace("regi... | [
"@",
"Override",
"public",
"void",
"registerOsgiProviders",
"(",
"Collection",
"<",
"Object",
">",
"providers",
")",
"throws",
"FhirConfigurationException",
"{",
"if",
"(",
"null",
"==",
"providers",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"FHIR P... | Dynamically registers a list of providers with the RestfulServer
@param provider the providers to be registered
@throws FhirConfigurationException | [
"Dynamically",
"registers",
"a",
"list",
"of",
"providers",
"with",
"the",
"RestfulServer"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/FhirServerImpl.java#L102-L117 |
22,458 | jamesagnew/hapi-fhir | hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/FhirServerImpl.java | FhirServerImpl.unregisterOsgiProviders | @Override
public void unregisterOsgiProviders (Collection<Object> providers) throws FhirConfigurationException {
if (null == providers) {
throw new NullPointerException("FHIR Provider list cannot be null");
}
try {
for (Object provider : providers) {
log.trace("unregistered provider. class ["+provider.... | java | @Override
public void unregisterOsgiProviders (Collection<Object> providers) throws FhirConfigurationException {
if (null == providers) {
throw new NullPointerException("FHIR Provider list cannot be null");
}
try {
for (Object provider : providers) {
log.trace("unregistered provider. class ["+provider.... | [
"@",
"Override",
"public",
"void",
"unregisterOsgiProviders",
"(",
"Collection",
"<",
"Object",
">",
"providers",
")",
"throws",
"FhirConfigurationException",
"{",
"if",
"(",
"null",
"==",
"providers",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"FHIR... | Dynamically unregisters a list of providers with the RestfulServer
@param provider the providers to be unregistered
@throws FhirConfigurationException | [
"Dynamically",
"unregisters",
"a",
"list",
"of",
"providers",
"with",
"the",
"RestfulServer"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/FhirServerImpl.java#L125-L140 |
22,459 | jamesagnew/hapi-fhir | hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/FhirServerImpl.java | FhirServerImpl.unregisterOsgiProviders | @Override
public void unregisterOsgiProviders () throws FhirConfigurationException {
// need to make a copy to be able to remove items
Collection<Object> providers = new ArrayList<Object>();
providers.addAll(this.serverProviders);
this.unregisterOsgiProviders(providers);
} | java | @Override
public void unregisterOsgiProviders () throws FhirConfigurationException {
// need to make a copy to be able to remove items
Collection<Object> providers = new ArrayList<Object>();
providers.addAll(this.serverProviders);
this.unregisterOsgiProviders(providers);
} | [
"@",
"Override",
"public",
"void",
"unregisterOsgiProviders",
"(",
")",
"throws",
"FhirConfigurationException",
"{",
"// need to make a copy to be able to remove items",
"Collection",
"<",
"Object",
">",
"providers",
"=",
"new",
"ArrayList",
"<",
"Object",
">",
"(",
")"... | Dynamically unregisters all of providers currently registered
@throws FhirConfigurationException | [
"Dynamically",
"unregisters",
"all",
"of",
"providers",
"currently",
"registered"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-osgi-core/src/main/java/ca/uhn/fhir/osgi/FhirServerImpl.java#L147-L153 |
22,460 | jamesagnew/hapi-fhir | hapi-fhir-tutorial/simple-server/src/main/java/ca/uhn/fhir/example/ex3/Example03_PatientResourceProvider.java | Example03_PatientResourceProvider.search | @Search
public List<Patient> search(@RequiredParam(name="family") StringParam theParam) {
List<Patient> retVal = new ArrayList<Patient>();
// Loop through the patients looking for matches
for (Patient next : myPatients.values()) {
String familyName = next.getNameFirstRep().getFamilyAsSingleString().toLowerCa... | java | @Search
public List<Patient> search(@RequiredParam(name="family") StringParam theParam) {
List<Patient> retVal = new ArrayList<Patient>();
// Loop through the patients looking for matches
for (Patient next : myPatients.values()) {
String familyName = next.getNameFirstRep().getFamilyAsSingleString().toLowerCa... | [
"@",
"Search",
"public",
"List",
"<",
"Patient",
">",
"search",
"(",
"@",
"RequiredParam",
"(",
"name",
"=",
"\"family\"",
")",
"StringParam",
"theParam",
")",
"{",
"List",
"<",
"Patient",
">",
"retVal",
"=",
"new",
"ArrayList",
"<",
"Patient",
">",
"(",... | A search with a parameter | [
"A",
"search",
"with",
"a",
"parameter"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-tutorial/simple-server/src/main/java/ca/uhn/fhir/example/ex3/Example03_PatientResourceProvider.java#L82-L96 |
22,461 | jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/BaseParamWithPrefix.java | BaseParamWithPrefix.extractPrefixAndReturnRest | String extractPrefixAndReturnRest(String theString) {
int offset = 0;
while (true) {
if (theString.length() == offset) {
break;
} else {
char nextChar = theString.charAt(offset);
if (nextChar == '-' || Character.isDigit(nextChar)) {
break;
}
}
offset++;
}
String prefix = theStr... | java | String extractPrefixAndReturnRest(String theString) {
int offset = 0;
while (true) {
if (theString.length() == offset) {
break;
} else {
char nextChar = theString.charAt(offset);
if (nextChar == '-' || Character.isDigit(nextChar)) {
break;
}
}
offset++;
}
String prefix = theStr... | [
"String",
"extractPrefixAndReturnRest",
"(",
"String",
"theString",
")",
"{",
"int",
"offset",
"=",
"0",
";",
"while",
"(",
"true",
")",
"{",
"if",
"(",
"theString",
".",
"length",
"(",
")",
"==",
"offset",
")",
"{",
"break",
";",
"}",
"else",
"{",
"... | Eg. if this is invoked with "gt2012-11-02", sets the prefix to GREATER_THAN and returns "2012-11-02" | [
"Eg",
".",
"if",
"this",
"is",
"invoked",
"with",
"gt2012",
"-",
"11",
"-",
"02",
"sets",
"the",
"prefix",
"to",
"GREATER_THAN",
"and",
"returns",
"2012",
"-",
"11",
"-",
"02"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/BaseParamWithPrefix.java#L43-L93 |
22,462 | jamesagnew/hapi-fhir | hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java | BaseHapiFhirResourceDao.preProcessResourceForStorage | protected void preProcessResourceForStorage(T theResource) {
String type = getContext().getResourceDefinition(theResource).getName();
if (!getResourceName().equals(type)) {
throw new InvalidRequestException(getContext().getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "incorrectResourceType", type, getRe... | java | protected void preProcessResourceForStorage(T theResource) {
String type = getContext().getResourceDefinition(theResource).getName();
if (!getResourceName().equals(type)) {
throw new InvalidRequestException(getContext().getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "incorrectResourceType", type, getRe... | [
"protected",
"void",
"preProcessResourceForStorage",
"(",
"T",
"theResource",
")",
"{",
"String",
"type",
"=",
"getContext",
"(",
")",
".",
"getResourceDefinition",
"(",
"theResource",
")",
".",
"getName",
"(",
")",
";",
"if",
"(",
"!",
"getResourceName",
"(",... | May be overridden by subclasses to validate resources prior to storage
@param theResource The resource that is about to be stored | [
"May",
"be",
"overridden",
"by",
"subclasses",
"to",
"validate",
"resources",
"prior",
"to",
"storage"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java#L831-L859 |
22,463 | jamesagnew/hapi-fhir | hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java | BaseHapiFhirResourceDao.validateCriteriaAndReturnResourceDefinition | @Override
public RuntimeResourceDefinition validateCriteriaAndReturnResourceDefinition(String criteria) {
String resourceName;
if (criteria == null || criteria.trim().isEmpty()) {
throw new IllegalArgumentException("Criteria cannot be empty");
}
if (criteria.contains("?")) {
resourceName = criteria.subst... | java | @Override
public RuntimeResourceDefinition validateCriteriaAndReturnResourceDefinition(String criteria) {
String resourceName;
if (criteria == null || criteria.trim().isEmpty()) {
throw new IllegalArgumentException("Criteria cannot be empty");
}
if (criteria.contains("?")) {
resourceName = criteria.subst... | [
"@",
"Override",
"public",
"RuntimeResourceDefinition",
"validateCriteriaAndReturnResourceDefinition",
"(",
"String",
"criteria",
")",
"{",
"String",
"resourceName",
";",
"if",
"(",
"criteria",
"==",
"null",
"||",
"criteria",
".",
"trim",
"(",
")",
".",
"isEmpty",
... | Get the resource definition from the criteria which specifies the resource type
@param criteria
@return | [
"Get",
"the",
"resource",
"definition",
"from",
"the",
"criteria",
"which",
"specifies",
"the",
"resource",
"type"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java#L1366-L1379 |
22,464 | jamesagnew/hapi-fhir | hapi-fhir-converter/src/main/java/org/hl7/fhir/convertors/Convert.java | Convert.makeDateTimeFromIVL | public DateTimeType makeDateTimeFromIVL(Element ivl) throws Exception {
if (ivl == null)
return null;
if (ivl.hasAttribute("value"))
return makeDateTimeFromTS(ivl);
Element high = cda.getChild(ivl, "high");
if (high != null)
return makeDateTimeFromTS(high);
Element low = cda.getChild(ivl, ... | java | public DateTimeType makeDateTimeFromIVL(Element ivl) throws Exception {
if (ivl == null)
return null;
if (ivl.hasAttribute("value"))
return makeDateTimeFromTS(ivl);
Element high = cda.getChild(ivl, "high");
if (high != null)
return makeDateTimeFromTS(high);
Element low = cda.getChild(ivl, ... | [
"public",
"DateTimeType",
"makeDateTimeFromIVL",
"(",
"Element",
"ivl",
")",
"throws",
"Exception",
"{",
"if",
"(",
"ivl",
"==",
"null",
")",
"return",
"null",
";",
"if",
"(",
"ivl",
".",
"hasAttribute",
"(",
"\"value\"",
")",
")",
"return",
"makeDateTimeFro... | this is a weird one - where CDA has an IVL, and FHIR has a date | [
"this",
"is",
"a",
"weird",
"one",
"-",
"where",
"CDA",
"has",
"an",
"IVL",
"and",
"FHIR",
"has",
"a",
"date"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-converter/src/main/java/org/hl7/fhir/convertors/Convert.java#L418-L430 |
22,465 | jamesagnew/hapi-fhir | hapi-fhir-utilities/src/main/java/org/hl7/fhir/utilities/ucum/UcumEssenceService.java | UcumEssenceService.analyse | @Override
public String analyse(String unit) throws UcumException {
if (Utilities.noString(unit))
return "(unity)";
assert checkStringParam(unit) : paramError("analyse", "unit", "must not be null or empty");
Term term = new ExpressionParser(model).parse(unit);
return new FormalStructureComposer().compose(... | java | @Override
public String analyse(String unit) throws UcumException {
if (Utilities.noString(unit))
return "(unity)";
assert checkStringParam(unit) : paramError("analyse", "unit", "must not be null or empty");
Term term = new ExpressionParser(model).parse(unit);
return new FormalStructureComposer().compose(... | [
"@",
"Override",
"public",
"String",
"analyse",
"(",
"String",
"unit",
")",
"throws",
"UcumException",
"{",
"if",
"(",
"Utilities",
".",
"noString",
"(",
"unit",
")",
")",
"return",
"\"(unity)\"",
";",
"assert",
"checkStringParam",
"(",
"unit",
")",
":",
"... | given a unit, return a formal description of what the units stand for using
full names
@param units the unit code
@return formal description
@throws UcumException
@ | [
"given",
"a",
"unit",
"return",
"a",
"formal",
"description",
"of",
"what",
"the",
"units",
"stand",
"for",
"using",
"full",
"names"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-utilities/src/main/java/org/hl7/fhir/utilities/ucum/UcumEssenceService.java#L198-L205 |
22,466 | jamesagnew/hapi-fhir | hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/IncomingRequestAddressStrategy.java | IncomingRequestAddressStrategy.determineServletContextPath | public static String determineServletContextPath(HttpServletRequest theRequest, RestfulServer server) {
String retVal;
if (server.getServletContext() != null) {
if (server.getServletContext().getMajorVersion() >= 3 || (server.getServletContext().getMajorVersion() > 2 && server.getServletContext().getMinorVersion... | java | public static String determineServletContextPath(HttpServletRequest theRequest, RestfulServer server) {
String retVal;
if (server.getServletContext() != null) {
if (server.getServletContext().getMajorVersion() >= 3 || (server.getServletContext().getMajorVersion() > 2 && server.getServletContext().getMinorVersion... | [
"public",
"static",
"String",
"determineServletContextPath",
"(",
"HttpServletRequest",
"theRequest",
",",
"RestfulServer",
"server",
")",
"{",
"String",
"retVal",
";",
"if",
"(",
"server",
".",
"getServletContext",
"(",
")",
"!=",
"null",
")",
"{",
"if",
"(",
... | Determines the servlet's context path.
This is here to try and deal with the wide variation in servers and what they return.
getServletContext().getContextPath() is supposed to return the path to the specific servlet we are deployed as but it's not available everywhere. On some servers getServletContext() can return
... | [
"Determines",
"the",
"servlet",
"s",
"context",
"path",
"."
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/IncomingRequestAddressStrategy.java#L124-L137 |
22,467 | jamesagnew/hapi-fhir | hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/terminologies/CodeSystemUtilities.java | CodeSystemUtilities.getOtherChildren | public static List<String> getOtherChildren(CodeSystem cs, ConceptDefinitionComponent c) {
List<String> res = new ArrayList<String>();
for (ConceptPropertyComponent p : c.getProperty()) {
if ("parent".equals(p.getCode())) {
res.add(p.getValue().primitiveValue());
}
}
return re... | java | public static List<String> getOtherChildren(CodeSystem cs, ConceptDefinitionComponent c) {
List<String> res = new ArrayList<String>();
for (ConceptPropertyComponent p : c.getProperty()) {
if ("parent".equals(p.getCode())) {
res.add(p.getValue().primitiveValue());
}
}
return re... | [
"public",
"static",
"List",
"<",
"String",
">",
"getOtherChildren",
"(",
"CodeSystem",
"cs",
",",
"ConceptDefinitionComponent",
"c",
")",
"{",
"List",
"<",
"String",
">",
"res",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"Con... | returns additional parents not in the heirarchy | [
"returns",
"additional",
"parents",
"not",
"in",
"the",
"heirarchy"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/terminologies/CodeSystemUtilities.java#L243-L251 |
22,468 | jamesagnew/hapi-fhir | hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/model/BaseDateTimeType.java | BaseDateTimeType.equalsUsingFhirPathRules | public Boolean equalsUsingFhirPathRules(BaseDateTimeType theOther) {
BaseDateTimeType me = this;
// Per FHIRPath rules, we compare equivalence at the lowest precision of the two values,
// so if we need to, we'll clone either side and reduce its precision
int lowestPrecision = Math.min(me.getPreci... | java | public Boolean equalsUsingFhirPathRules(BaseDateTimeType theOther) {
BaseDateTimeType me = this;
// Per FHIRPath rules, we compare equivalence at the lowest precision of the two values,
// so if we need to, we'll clone either side and reduce its precision
int lowestPrecision = Math.min(me.getPreci... | [
"public",
"Boolean",
"equalsUsingFhirPathRules",
"(",
"BaseDateTimeType",
"theOther",
")",
"{",
"BaseDateTimeType",
"me",
"=",
"this",
";",
"// Per FHIRPath rules, we compare equivalence at the lowest precision of the two values,",
"// so if we need to, we'll clone either side and reduce... | This method implements a datetime equality check using the rules as defined by FHIRPath.
This method returns:
<ul>
<li>true if the given datetimes represent the exact same instant with the same precision (irrespective of the timezone)</li>
<li>true if the given datetimes represent the exact same instant but one includ... | [
"This",
"method",
"implements",
"a",
"datetime",
"equality",
"check",
"using",
"the",
"rules",
"as",
"defined",
"by",
"FHIRPath",
"."
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/model/BaseDateTimeType.java#L878-L932 |
22,469 | jamesagnew/hapi-fhir | hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/subscriber/ResourceDeliveryMessage.java | ResourceDeliveryMessage.getSubscriptionId | public String getSubscriptionId(FhirContext theFhirContext) {
String retVal = null;
if (getSubscription() != null) {
retVal = getSubscription().getIdElement(theFhirContext).getValue();
}
return retVal;
} | java | public String getSubscriptionId(FhirContext theFhirContext) {
String retVal = null;
if (getSubscription() != null) {
retVal = getSubscription().getIdElement(theFhirContext).getValue();
}
return retVal;
} | [
"public",
"String",
"getSubscriptionId",
"(",
"FhirContext",
"theFhirContext",
")",
"{",
"String",
"retVal",
"=",
"null",
";",
"if",
"(",
"getSubscription",
"(",
")",
"!=",
"null",
")",
"{",
"retVal",
"=",
"getSubscription",
"(",
")",
".",
"getIdElement",
"(... | Helper method to fetch the subscription ID | [
"Helper",
"method",
"to",
"fetch",
"the",
"subscription",
"ID"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/subscriber/ResourceDeliveryMessage.java#L125-L131 |
22,470 | jamesagnew/hapi-fhir | hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java | PersistedJpaBundleProvider.ensureSearchEntityLoaded | public boolean ensureSearchEntityLoaded() {
if (mySearchEntity == null) {
ensureDependenciesInjected();
TransactionTemplate txTemplate = new TransactionTemplate(myPlatformTransactionManager);
txTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
txTemplate.setIsolationLevel(Trans... | java | public boolean ensureSearchEntityLoaded() {
if (mySearchEntity == null) {
ensureDependenciesInjected();
TransactionTemplate txTemplate = new TransactionTemplate(myPlatformTransactionManager);
txTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
txTemplate.setIsolationLevel(Trans... | [
"public",
"boolean",
"ensureSearchEntityLoaded",
"(",
")",
"{",
"if",
"(",
"mySearchEntity",
"==",
"null",
")",
"{",
"ensureDependenciesInjected",
"(",
")",
";",
"TransactionTemplate",
"txTemplate",
"=",
"new",
"TransactionTemplate",
"(",
"myPlatformTransactionManager",... | Returns false if the entity can't be found | [
"Returns",
"false",
"if",
"the",
"entity",
"can",
"t",
"be",
"found"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java#L154-L181 |
22,471 | jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/IdDt.java | IdDt.equalsIgnoreBase | @SuppressWarnings("deprecation")
public boolean equalsIgnoreBase(IdDt theId) {
if (theId == null) {
return false;
}
if (theId.isEmpty()) {
return isEmpty();
}
return ObjectUtils.equals(getResourceType(), theId.getResourceType()) && ObjectUtils.equals(getIdPart(), theId.getIdPart()) && ObjectUtils.equal... | java | @SuppressWarnings("deprecation")
public boolean equalsIgnoreBase(IdDt theId) {
if (theId == null) {
return false;
}
if (theId.isEmpty()) {
return isEmpty();
}
return ObjectUtils.equals(getResourceType(), theId.getResourceType()) && ObjectUtils.equals(getIdPart(), theId.getIdPart()) && ObjectUtils.equal... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"boolean",
"equalsIgnoreBase",
"(",
"IdDt",
"theId",
")",
"{",
"if",
"(",
"theId",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"theId",
".",
"isEmpty",
"(",
")",
")",
"... | Returns true if this IdDt matches the given IdDt in terms of resource type and ID, but ignores the URL base | [
"Returns",
"true",
"if",
"this",
"IdDt",
"matches",
"the",
"given",
"IdDt",
"in",
"terms",
"of",
"resource",
"type",
"and",
"ID",
"but",
"ignores",
"the",
"URL",
"base"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/IdDt.java#L203-L212 |
22,472 | jamesagnew/hapi-fhir | hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/interceptor/JaxRsExceptionInterceptor.java | JaxRsExceptionInterceptor.intercept | @AroundInvoke
public Object intercept(final InvocationContext ctx)
throws JaxRsResponseException {
try {
return ctx.proceed();
}
catch (final Exception theException) {
final AbstractJaxRsProvider theServer = (AbstractJaxRsProvider) ctx.getTarget();
... | java | @AroundInvoke
public Object intercept(final InvocationContext ctx)
throws JaxRsResponseException {
try {
return ctx.proceed();
}
catch (final Exception theException) {
final AbstractJaxRsProvider theServer = (AbstractJaxRsProvider) ctx.getTarget();
... | [
"@",
"AroundInvoke",
"public",
"Object",
"intercept",
"(",
"final",
"InvocationContext",
"ctx",
")",
"throws",
"JaxRsResponseException",
"{",
"try",
"{",
"return",
"ctx",
".",
"proceed",
"(",
")",
";",
"}",
"catch",
"(",
"final",
"Exception",
"theException",
"... | This interceptor will catch all exception and convert them using the exceptionhandler
@param ctx the invocation context
@return the result
@throws JaxRsResponseException an exception that can be handled by a jee container | [
"This",
"interceptor",
"will",
"catch",
"all",
"exception",
"and",
"convert",
"them",
"using",
"the",
"exceptionhandler"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/interceptor/JaxRsExceptionInterceptor.java#L67-L77 |
22,473 | jamesagnew/hapi-fhir | hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/interceptor/JaxRsExceptionInterceptor.java | JaxRsExceptionInterceptor.convertException | public JaxRsResponseException convertException(final AbstractJaxRsProvider theServer, final Throwable theException) {
if (theServer.withStackTrace()) {
exceptionHandler.setReturnStackTracesForExceptionTypes(Throwable.class);
}
final JaxRsRequest requestDetails = theServer.getRequest(... | java | public JaxRsResponseException convertException(final AbstractJaxRsProvider theServer, final Throwable theException) {
if (theServer.withStackTrace()) {
exceptionHandler.setReturnStackTracesForExceptionTypes(Throwable.class);
}
final JaxRsRequest requestDetails = theServer.getRequest(... | [
"public",
"JaxRsResponseException",
"convertException",
"(",
"final",
"AbstractJaxRsProvider",
"theServer",
",",
"final",
"Throwable",
"theException",
")",
"{",
"if",
"(",
"theServer",
".",
"withStackTrace",
"(",
")",
")",
"{",
"exceptionHandler",
".",
"setReturnStack... | This method convert an exception to a JaxRsResponseException
@param theServer the provider
@param theException the exception to convert
@return JaxRsResponseException | [
"This",
"method",
"convert",
"an",
"exception",
"to",
"a",
"JaxRsResponseException"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/interceptor/JaxRsExceptionInterceptor.java#L85-L92 |
22,474 | jamesagnew/hapi-fhir | hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/interceptor/JaxRsExceptionInterceptor.java | JaxRsExceptionInterceptor.convertExceptionIntoResponse | public Response convertExceptionIntoResponse(final JaxRsRequest theRequest, final JaxRsResponseException theException)
throws IOException {
return handleExceptionWithoutServletError(theRequest, theException);
} | java | public Response convertExceptionIntoResponse(final JaxRsRequest theRequest, final JaxRsResponseException theException)
throws IOException {
return handleExceptionWithoutServletError(theRequest, theException);
} | [
"public",
"Response",
"convertExceptionIntoResponse",
"(",
"final",
"JaxRsRequest",
"theRequest",
",",
"final",
"JaxRsResponseException",
"theException",
")",
"throws",
"IOException",
"{",
"return",
"handleExceptionWithoutServletError",
"(",
"theRequest",
",",
"theException",... | This method converts an exception into a response
@param theRequest the request
@param theException the thrown exception
@return the response describing the error
@throws IOException | [
"This",
"method",
"converts",
"an",
"exception",
"into",
"a",
"response"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/interceptor/JaxRsExceptionInterceptor.java#L101-L104 |
22,475 | jamesagnew/hapi-fhir | hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/SpringObjectCaster.java | SpringObjectCaster.getTargetObject | public static <T> T getTargetObject(Object proxy, Class<T> clazz) throws Exception {
while( (AopUtils.isJdkDynamicProxy(proxy))) {
return clazz.cast(getTargetObject(((Advised)proxy).getTargetSource().getTarget(), clazz));
}
return clazz.cast(proxy);
} | java | public static <T> T getTargetObject(Object proxy, Class<T> clazz) throws Exception {
while( (AopUtils.isJdkDynamicProxy(proxy))) {
return clazz.cast(getTargetObject(((Advised)proxy).getTargetSource().getTarget(), clazz));
}
return clazz.cast(proxy);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getTargetObject",
"(",
"Object",
"proxy",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"throws",
"Exception",
"{",
"while",
"(",
"(",
"AopUtils",
".",
"isJdkDynamicProxy",
"(",
"proxy",
")",
")",
")",
"{",
"return... | Retrieve the Spring proxy object's target object
@param proxy
@param clazz
@param <T>
@return
@throws Exception | [
"Retrieve",
"the",
"Spring",
"proxy",
"object",
"s",
"target",
"object"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/SpringObjectCaster.java#L40-L46 |
22,476 | jamesagnew/hapi-fhir | hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/BundleProviders.java | BundleProviders.newEmptyList | public static IBundleProvider newEmptyList() {
final InstantDt published = InstantDt.withCurrentTime();
return new IBundleProvider() {
@Override
public List<IBaseResource> getResources(int theFromIndex, int theToIndex) {
return Collections.emptyList();
}
@Override
public Integer size() {
ret... | java | public static IBundleProvider newEmptyList() {
final InstantDt published = InstantDt.withCurrentTime();
return new IBundleProvider() {
@Override
public List<IBaseResource> getResources(int theFromIndex, int theToIndex) {
return Collections.emptyList();
}
@Override
public Integer size() {
ret... | [
"public",
"static",
"IBundleProvider",
"newEmptyList",
"(",
")",
"{",
"final",
"InstantDt",
"published",
"=",
"InstantDt",
".",
"withCurrentTime",
"(",
")",
";",
"return",
"new",
"IBundleProvider",
"(",
")",
"{",
"@",
"Override",
"public",
"List",
"<",
"IBaseR... | Create a new unmodifiable empty resource list with the current time as the publish date. | [
"Create",
"a",
"new",
"unmodifiable",
"empty",
"resource",
"list",
"with",
"the",
"current",
"time",
"as",
"the",
"publish",
"date",
"."
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/BundleProviders.java#L46-L74 |
22,477 | jamesagnew/hapi-fhir | hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/interceptor/AdditionalRequestHeadersInterceptor.java | AdditionalRequestHeadersInterceptor.getHeaderValues | private List<String> getHeaderValues(String headerName) {
if (additionalHttpHeaders.get(headerName) == null) {
additionalHttpHeaders.put(headerName, new ArrayList<String>());
}
return additionalHttpHeaders.get(headerName);
} | java | private List<String> getHeaderValues(String headerName) {
if (additionalHttpHeaders.get(headerName) == null) {
additionalHttpHeaders.put(headerName, new ArrayList<String>());
}
return additionalHttpHeaders.get(headerName);
} | [
"private",
"List",
"<",
"String",
">",
"getHeaderValues",
"(",
"String",
"headerName",
")",
"{",
"if",
"(",
"additionalHttpHeaders",
".",
"get",
"(",
"headerName",
")",
"==",
"null",
")",
"{",
"additionalHttpHeaders",
".",
"put",
"(",
"headerName",
",",
"new... | Gets the header values list for a given header.
If the header doesn't have any values, an empty list will be returned.
@param headerName the name of the header
@return the list of values for the header | [
"Gets",
"the",
"header",
"values",
"list",
"for",
"a",
"given",
"header",
".",
"If",
"the",
"header",
"doesn",
"t",
"have",
"any",
"values",
"an",
"empty",
"list",
"will",
"be",
"returned",
"."
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/interceptor/AdditionalRequestHeadersInterceptor.java#L85-L90 |
22,478 | jamesagnew/hapi-fhir | hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/interceptor/AdditionalRequestHeadersInterceptor.java | AdditionalRequestHeadersInterceptor.interceptRequest | @Override
public void interceptRequest(IHttpRequest theRequest) {
for (Map.Entry<String, List<String>> header : additionalHttpHeaders.entrySet()) {
for (String headerValue : header.getValue()) {
if (headerValue != null) {
theRequest.addHeader(header.getKey(), headerValue);
}
}
}
} | java | @Override
public void interceptRequest(IHttpRequest theRequest) {
for (Map.Entry<String, List<String>> header : additionalHttpHeaders.entrySet()) {
for (String headerValue : header.getValue()) {
if (headerValue != null) {
theRequest.addHeader(header.getKey(), headerValue);
}
}
}
} | [
"@",
"Override",
"public",
"void",
"interceptRequest",
"(",
"IHttpRequest",
"theRequest",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"header",
":",
"additionalHttpHeaders",
".",
"entrySet",
"(",
")",
")"... | Adds the additional header values to the HTTP request.
@param theRequest the HTTP request | [
"Adds",
"the",
"additional",
"header",
"values",
"to",
"the",
"HTTP",
"request",
"."
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/interceptor/AdditionalRequestHeadersInterceptor.java#L96-L105 |
22,479 | jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/context/BaseRuntimeElementDefinition.java | BaseRuntimeElementDefinition.sealAndInitialize | void sealAndInitialize(FhirContext theContext, Map<Class<? extends IBase>, BaseRuntimeElementDefinition<?>> theClassToElementDefinitions) {
for (BaseRuntimeChildDefinition next : myExtensions) {
next.sealAndInitialize(theContext, theClassToElementDefinitions);
}
for (RuntimeChildDeclaredExtensionDefinition ne... | java | void sealAndInitialize(FhirContext theContext, Map<Class<? extends IBase>, BaseRuntimeElementDefinition<?>> theClassToElementDefinitions) {
for (BaseRuntimeChildDefinition next : myExtensions) {
next.sealAndInitialize(theContext, theClassToElementDefinitions);
}
for (RuntimeChildDeclaredExtensionDefinition ne... | [
"void",
"sealAndInitialize",
"(",
"FhirContext",
"theContext",
",",
"Map",
"<",
"Class",
"<",
"?",
"extends",
"IBase",
">",
",",
"BaseRuntimeElementDefinition",
"<",
"?",
">",
">",
"theClassToElementDefinitions",
")",
"{",
"for",
"(",
"BaseRuntimeChildDefinition",
... | Invoked prior to use to perform any initialization and make object
mutable.
@param theContext TODO | [
"Invoked",
"prior",
"to",
"use",
"to",
"perform",
"any",
"initialization",
"and",
"make",
"object",
"mutable",
"."
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/BaseRuntimeElementDefinition.java#L176-L196 |
22,480 | jamesagnew/hapi-fhir | hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java | ShExGenerator.emitInnerTypes | private String emitInnerTypes() {
StringBuilder itDefs = new StringBuilder();
while(emittedInnerTypes.size() < innerTypes.size()) {
for (Pair<StructureDefinition, ElementDefinition> it : new HashSet<Pair<StructureDefinition, ElementDefinition>>(innerTypes)) {
if (!emittedInnerTypes.contains(it... | java | private String emitInnerTypes() {
StringBuilder itDefs = new StringBuilder();
while(emittedInnerTypes.size() < innerTypes.size()) {
for (Pair<StructureDefinition, ElementDefinition> it : new HashSet<Pair<StructureDefinition, ElementDefinition>>(innerTypes)) {
if (!emittedInnerTypes.contains(it... | [
"private",
"String",
"emitInnerTypes",
"(",
")",
"{",
"StringBuilder",
"itDefs",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"while",
"(",
"emittedInnerTypes",
".",
"size",
"(",
")",
"<",
"innerTypes",
".",
"size",
"(",
")",
")",
"{",
"for",
"(",
"Pair",... | Generate a flattened definition for the inner types
@return stringified inner type definitions | [
"Generate",
"a",
"flattened",
"definition",
"for",
"the",
"inner",
"types"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java#L368-L379 |
22,481 | jamesagnew/hapi-fhir | hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java | ShExGenerator.emitDataTypes | private String emitDataTypes() {
StringBuilder dtDefs = new StringBuilder();
while (emittedDatatypes.size() < datatypes.size()) {
for (String dt : new HashSet<String>(datatypes)) {
if (!emittedDatatypes.contains(dt)) {
StructureDefinition sd = context.fetchResource(StructureDefiniti... | java | private String emitDataTypes() {
StringBuilder dtDefs = new StringBuilder();
while (emittedDatatypes.size() < datatypes.size()) {
for (String dt : new HashSet<String>(datatypes)) {
if (!emittedDatatypes.contains(dt)) {
StructureDefinition sd = context.fetchResource(StructureDefiniti... | [
"private",
"String",
"emitDataTypes",
"(",
")",
"{",
"StringBuilder",
"dtDefs",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"while",
"(",
"emittedDatatypes",
".",
"size",
"(",
")",
"<",
"datatypes",
".",
"size",
"(",
")",
")",
"{",
"for",
"(",
"String",
... | Generate a shape definition for the current set of datatypes
@return stringified data type definitions | [
"Generate",
"a",
"shape",
"definition",
"for",
"the",
"current",
"set",
"of",
"datatypes"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java#L385-L401 |
22,482 | jamesagnew/hapi-fhir | hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java | ShExGenerator.simpleElement | private String simpleElement(StructureDefinition sd, ElementDefinition ed, String typ) {
String addldef = "";
ElementDefinition.ElementDefinitionBindingComponent binding = ed.getBinding();
if(binding.hasStrength() && binding.getStrength() == Enumerations.BindingStrength.REQUIRED && "code".equals(typ)) {
... | java | private String simpleElement(StructureDefinition sd, ElementDefinition ed, String typ) {
String addldef = "";
ElementDefinition.ElementDefinitionBindingComponent binding = ed.getBinding();
if(binding.hasStrength() && binding.getStrength() == Enumerations.BindingStrength.REQUIRED && "code".equals(typ)) {
... | [
"private",
"String",
"simpleElement",
"(",
"StructureDefinition",
"sd",
",",
"ElementDefinition",
"ed",
",",
"String",
"typ",
")",
"{",
"String",
"addldef",
"=",
"\"\"",
";",
"ElementDefinition",
".",
"ElementDefinitionBindingComponent",
"binding",
"=",
"ed",
".",
... | Generate a type reference and optional value set definition
@param sd Containing StructureDefinition
@param ed Element being defined
@param typ Element type
@return Type definition | [
"Generate",
"a",
"type",
"reference",
"and",
"optional",
"value",
"set",
"definition"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java#L520-L535 |
22,483 | jamesagnew/hapi-fhir | hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java | ShExGenerator.genTypeRef | private String genTypeRef(StructureDefinition sd, ElementDefinition ed, String id, ElementDefinition.TypeRefComponent typ) {
if(typ.hasProfile()) {
if(typ.getCode().equals("Reference"))
return genReference("", typ);
else if(ProfileUtilities.getChildList(sd, ed).size() > 0) {
// in... | java | private String genTypeRef(StructureDefinition sd, ElementDefinition ed, String id, ElementDefinition.TypeRefComponent typ) {
if(typ.hasProfile()) {
if(typ.getCode().equals("Reference"))
return genReference("", typ);
else if(ProfileUtilities.getChildList(sd, ed).size() > 0) {
// in... | [
"private",
"String",
"genTypeRef",
"(",
"StructureDefinition",
"sd",
",",
"ElementDefinition",
"ed",
",",
"String",
"id",
",",
"ElementDefinition",
".",
"TypeRefComponent",
"typ",
")",
"{",
"if",
"(",
"typ",
".",
"hasProfile",
"(",
")",
")",
"{",
"if",
"(",
... | Generate a type reference
@param sd Containing structure definition
@param ed Containing element definition
@param id Element id
@param typ Element type
@return Type reference string | [
"Generate",
"a",
"type",
"reference"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java#L551-L609 |
22,484 | jamesagnew/hapi-fhir | hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java | ShExGenerator.genAlternativeTypes | private ST genAlternativeTypes(ElementDefinition ed, String id, String shortId) {
ST shex_alt = tmplt(ALTERNATIVE_SHAPES_TEMPLATE);
List<String> altEntries = new ArrayList<String>();
for(ElementDefinition.TypeRefComponent typ : ed.getType()) {
altEntries.add(genAltEntry(id, typ));
}
... | java | private ST genAlternativeTypes(ElementDefinition ed, String id, String shortId) {
ST shex_alt = tmplt(ALTERNATIVE_SHAPES_TEMPLATE);
List<String> altEntries = new ArrayList<String>();
for(ElementDefinition.TypeRefComponent typ : ed.getType()) {
altEntries.add(genAltEntry(id, typ));
}
... | [
"private",
"ST",
"genAlternativeTypes",
"(",
"ElementDefinition",
"ed",
",",
"String",
"id",
",",
"String",
"shortId",
")",
"{",
"ST",
"shex_alt",
"=",
"tmplt",
"(",
"ALTERNATIVE_SHAPES_TEMPLATE",
")",
";",
"List",
"<",
"String",
">",
"altEntries",
"=",
"new",... | Generate a set of alternative shapes
@param ed Containing element definition
@param id Element definition identifier
@param shortId id to use in the actual definition
@return ShEx list of alternative anonymous shapes separated by "OR" | [
"Generate",
"a",
"set",
"of",
"alternative",
"shapes"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java#L618-L628 |
22,485 | jamesagnew/hapi-fhir | hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java | ShExGenerator.genAltEntry | private String genAltEntry(String id, ElementDefinition.TypeRefComponent typ) {
if(!typ.getCode().equals("Reference"))
throw new AssertionError("We do not handle " + typ.getCode() + " alternatives");
return genReference(id, typ);
} | java | private String genAltEntry(String id, ElementDefinition.TypeRefComponent typ) {
if(!typ.getCode().equals("Reference"))
throw new AssertionError("We do not handle " + typ.getCode() + " alternatives");
return genReference(id, typ);
} | [
"private",
"String",
"genAltEntry",
"(",
"String",
"id",
",",
"ElementDefinition",
".",
"TypeRefComponent",
"typ",
")",
"{",
"if",
"(",
"!",
"typ",
".",
"getCode",
"(",
")",
".",
"equals",
"(",
"\"Reference\"",
")",
")",
"throw",
"new",
"AssertionError",
"... | Generate an alternative shape for a reference
@param id reference name
@param typ shape type
@return ShEx equivalent | [
"Generate",
"an",
"alternative",
"shape",
"for",
"a",
"reference"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java#L638-L643 |
22,486 | jamesagnew/hapi-fhir | hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java | ShExGenerator.genChoiceEntry | private String genChoiceEntry(StructureDefinition sd, ElementDefinition ed, String id, String base, ElementDefinition.TypeRefComponent typ) {
ST shex_choice_entry = tmplt(ELEMENT_TEMPLATE);
String ext = typ.getCode();
shex_choice_entry.add("id", "fhir:" + base+Character.toUpperCase(ext.charAt(0)) + ext... | java | private String genChoiceEntry(StructureDefinition sd, ElementDefinition ed, String id, String base, ElementDefinition.TypeRefComponent typ) {
ST shex_choice_entry = tmplt(ELEMENT_TEMPLATE);
String ext = typ.getCode();
shex_choice_entry.add("id", "fhir:" + base+Character.toUpperCase(ext.charAt(0)) + ext... | [
"private",
"String",
"genChoiceEntry",
"(",
"StructureDefinition",
"sd",
",",
"ElementDefinition",
"ed",
",",
"String",
"id",
",",
"String",
"base",
",",
"ElementDefinition",
".",
"TypeRefComponent",
"typ",
")",
"{",
"ST",
"shex_choice_entry",
"=",
"tmplt",
"(",
... | Generate an entry in a choice list
@param base base identifier
@param typ type/discriminant
@return ShEx fragment for choice entry | [
"Generate",
"an",
"entry",
"in",
"a",
"choice",
"list"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java#L668-L677 |
22,487 | jamesagnew/hapi-fhir | hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java | ShExGenerator.genInnerTypeDef | private String genInnerTypeDef(StructureDefinition sd, ElementDefinition ed) {
String path = ed.hasBase() ? ed.getBase().getPath() : ed.getPath();;
ST element_reference = tmplt(SHAPE_DEFINITION_TEMPLATE);
element_reference.add("resourceDecl", ""); // Not a resource
element_reference.add("id", path)... | java | private String genInnerTypeDef(StructureDefinition sd, ElementDefinition ed) {
String path = ed.hasBase() ? ed.getBase().getPath() : ed.getPath();;
ST element_reference = tmplt(SHAPE_DEFINITION_TEMPLATE);
element_reference.add("resourceDecl", ""); // Not a resource
element_reference.add("id", path)... | [
"private",
"String",
"genInnerTypeDef",
"(",
"StructureDefinition",
"sd",
",",
"ElementDefinition",
"ed",
")",
"{",
"String",
"path",
"=",
"ed",
".",
"hasBase",
"(",
")",
"?",
"ed",
".",
"getBase",
"(",
")",
".",
"getPath",
"(",
")",
":",
"ed",
".",
"g... | Generate a definition for a referenced element
@param sd Containing structure definition
@param ed Inner element
@return ShEx representation of element reference | [
"Generate",
"a",
"definition",
"for",
"a",
"referenced",
"element"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java#L685-L699 |
22,488 | jamesagnew/hapi-fhir | hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java | ShExGenerator.genReference | private String genReference(String id, ElementDefinition.TypeRefComponent typ) {
ST shex_ref = tmplt(REFERENCE_DEFN_TEMPLATE);
String ref = getTypeName(typ);
shex_ref.add("id", id);
shex_ref.add("ref", ref);
references.add(ref);
return shex_ref.render();
} | java | private String genReference(String id, ElementDefinition.TypeRefComponent typ) {
ST shex_ref = tmplt(REFERENCE_DEFN_TEMPLATE);
String ref = getTypeName(typ);
shex_ref.add("id", id);
shex_ref.add("ref", ref);
references.add(ref);
return shex_ref.render();
} | [
"private",
"String",
"genReference",
"(",
"String",
"id",
",",
"ElementDefinition",
".",
"TypeRefComponent",
"typ",
")",
"{",
"ST",
"shex_ref",
"=",
"tmplt",
"(",
"REFERENCE_DEFN_TEMPLATE",
")",
";",
"String",
"ref",
"=",
"getTypeName",
"(",
"typ",
")",
";",
... | Generate a reference to a resource
@param id attribute identifier
@param typ possible reference types
@return string that represents the result | [
"Generate",
"a",
"reference",
"to",
"a",
"resource"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java#L707-L715 |
22,489 | jamesagnew/hapi-fhir | hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java | ShExGenerator.getTypeName | private String getTypeName(ElementDefinition.TypeRefComponent typ) {
// TODO: This is brittle. There has to be a utility to do this...
if (typ.hasTargetProfile()) {
String[] els = typ.getTargetProfile().get(0).getValue().split("/");
return els[els.length - 1];
} else if (typ.hasProfile()) {... | java | private String getTypeName(ElementDefinition.TypeRefComponent typ) {
// TODO: This is brittle. There has to be a utility to do this...
if (typ.hasTargetProfile()) {
String[] els = typ.getTargetProfile().get(0).getValue().split("/");
return els[els.length - 1];
} else if (typ.hasProfile()) {... | [
"private",
"String",
"getTypeName",
"(",
"ElementDefinition",
".",
"TypeRefComponent",
"typ",
")",
"{",
"// TODO: This is brittle. There has to be a utility to do this...\r",
"if",
"(",
"typ",
".",
"hasTargetProfile",
"(",
")",
")",
"{",
"String",
"[",
"]",
"els",
"="... | Return the type name for typ
@param typ type to get name for
@return name | [
"Return",
"the",
"type",
"name",
"for",
"typ"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java#L722-L733 |
22,490 | jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/QuantityClientParam.java | QuantityClientParam.withPrefix | public IMatches<IAndUnits> withPrefix(final ParamPrefixEnum thePrefix) {
return new NumberClientParam.IMatches<IAndUnits>() {
@Override
public IAndUnits number(long theNumber) {
return new AndUnits(thePrefix, Long.toString(theNumber));
}
@Override
public IAndUnits number(String theNumber) {
re... | java | public IMatches<IAndUnits> withPrefix(final ParamPrefixEnum thePrefix) {
return new NumberClientParam.IMatches<IAndUnits>() {
@Override
public IAndUnits number(long theNumber) {
return new AndUnits(thePrefix, Long.toString(theNumber));
}
@Override
public IAndUnits number(String theNumber) {
re... | [
"public",
"IMatches",
"<",
"IAndUnits",
">",
"withPrefix",
"(",
"final",
"ParamPrefixEnum",
"thePrefix",
")",
"{",
"return",
"new",
"NumberClientParam",
".",
"IMatches",
"<",
"IAndUnits",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"IAndUnits",
"number",
"(... | Use the given quantity prefix
@param thePrefix The prefix, or <code>null</code> for no prefix | [
"Use",
"the",
"given",
"quantity",
"prefix"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/QuantityClientParam.java#L133-L145 |
22,491 | jamesagnew/hapi-fhir | hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java | RestfulServer.determineResourceMethod | public BaseMethodBinding<?> determineResourceMethod(RequestDetails requestDetails, String requestPath) {
RequestTypeEnum requestType = requestDetails.getRequestType();
ResourceBinding resourceBinding = null;
BaseMethodBinding<?> resourceMethod = null;
String resourceName = requestDetails.getResourceName();
i... | java | public BaseMethodBinding<?> determineResourceMethod(RequestDetails requestDetails, String requestPath) {
RequestTypeEnum requestType = requestDetails.getRequestType();
ResourceBinding resourceBinding = null;
BaseMethodBinding<?> resourceMethod = null;
String resourceName = requestDetails.getResourceName();
i... | [
"public",
"BaseMethodBinding",
"<",
"?",
">",
"determineResourceMethod",
"(",
"RequestDetails",
"requestDetails",
",",
"String",
"requestPath",
")",
"{",
"RequestTypeEnum",
"requestType",
"=",
"requestDetails",
".",
"getRequestType",
"(",
")",
";",
"ResourceBinding",
... | Figure out and return whichever method binding is appropriate for
the given request | [
"Figure",
"out",
"and",
"return",
"whichever",
"method",
"binding",
"is",
"appropriate",
"for",
"the",
"given",
"request"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java#L292-L324 |
22,492 | jamesagnew/hapi-fhir | hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java | RestfulServer.getInterceptors_ | @Deprecated
@Override
public List<IServerInterceptor> getInterceptors_() {
List<IServerInterceptor> retVal = getInterceptorService()
.getAllRegisteredInterceptors()
.stream()
.filter(t -> t instanceof IServerInterceptor)
.map(t -> (IServerInterceptor) t)
.collect(Collectors.toList());
return Collec... | java | @Deprecated
@Override
public List<IServerInterceptor> getInterceptors_() {
List<IServerInterceptor> retVal = getInterceptorService()
.getAllRegisteredInterceptors()
.stream()
.filter(t -> t instanceof IServerInterceptor)
.map(t -> (IServerInterceptor) t)
.collect(Collectors.toList());
return Collec... | [
"@",
"Deprecated",
"@",
"Override",
"public",
"List",
"<",
"IServerInterceptor",
">",
"getInterceptors_",
"(",
")",
"{",
"List",
"<",
"IServerInterceptor",
">",
"retVal",
"=",
"getInterceptorService",
"(",
")",
".",
"getAllRegisteredInterceptors",
"(",
")",
".",
... | Returns a list of all registered server interceptors
@deprecated As of HAPI FHIR 3.8.0, use {@link #getInterceptorService()} to access the interceptor service. You can register and unregister interceptors using this service. | [
"Returns",
"a",
"list",
"of",
"all",
"registered",
"server",
"interceptors"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java#L566-L576 |
22,493 | jamesagnew/hapi-fhir | hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java | RestfulServer.setPlainProviders | @Deprecated
public void setPlainProviders(Collection<Object> theProviders) {
Validate.noNullElements(theProviders, "theProviders must not contain any null elements");
myPlainProviders.clear();
if (theProviders != null) {
myPlainProviders.addAll(theProviders);
}
} | java | @Deprecated
public void setPlainProviders(Collection<Object> theProviders) {
Validate.noNullElements(theProviders, "theProviders must not contain any null elements");
myPlainProviders.clear();
if (theProviders != null) {
myPlainProviders.addAll(theProviders);
}
} | [
"@",
"Deprecated",
"public",
"void",
"setPlainProviders",
"(",
"Collection",
"<",
"Object",
">",
"theProviders",
")",
"{",
"Validate",
".",
"noNullElements",
"(",
"theProviders",
",",
"\"theProviders must not contain any null elements\"",
")",
";",
"myPlainProviders",
"... | Sets the non-resource specific providers which implement method calls on this server.
@see #setResourceProviders(Collection)
@deprecated This method causes inconsistent behaviour depending on the order it is called in. Use {@link #registerProviders(Object...)} instead. | [
"Sets",
"the",
"non",
"-",
"resource",
"specific",
"providers",
"which",
"implement",
"method",
"calls",
"on",
"this",
"server",
"."
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java#L659-L667 |
22,494 | jamesagnew/hapi-fhir | hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java | RestfulServer.registerProvider | public void registerProvider(Object provider) {
if (provider != null) {
Collection<Object> providerList = new ArrayList<>(1);
providerList.add(provider);
registerProviders(providerList);
}
} | java | public void registerProvider(Object provider) {
if (provider != null) {
Collection<Object> providerList = new ArrayList<>(1);
providerList.add(provider);
registerProviders(providerList);
}
} | [
"public",
"void",
"registerProvider",
"(",
"Object",
"provider",
")",
"{",
"if",
"(",
"provider",
"!=",
"null",
")",
"{",
"Collection",
"<",
"Object",
">",
"providerList",
"=",
"new",
"ArrayList",
"<>",
"(",
"1",
")",
";",
"providerList",
".",
"add",
"("... | Register a single provider. This could be a Resource Provider or a "plain" provider not associated with any
resource. | [
"Register",
"a",
"single",
"provider",
".",
"This",
"could",
"be",
"a",
"Resource",
"Provider",
"or",
"a",
"plain",
"provider",
"not",
"associated",
"with",
"any",
"resource",
"."
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java#L1403-L1409 |
22,495 | jamesagnew/hapi-fhir | hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java | RestfulServer.registerProviders | public void registerProviders(Collection<?> theProviders) {
Validate.noNullElements(theProviders, "theProviders must not contain any null elements");
myProviderRegistrationMutex.lock();
try {
if (!myStarted) {
for (Object provider : theProviders) {
ourLog.info("Registration of provider [" + provider.... | java | public void registerProviders(Collection<?> theProviders) {
Validate.noNullElements(theProviders, "theProviders must not contain any null elements");
myProviderRegistrationMutex.lock();
try {
if (!myStarted) {
for (Object provider : theProviders) {
ourLog.info("Registration of provider [" + provider.... | [
"public",
"void",
"registerProviders",
"(",
"Collection",
"<",
"?",
">",
"theProviders",
")",
"{",
"Validate",
".",
"noNullElements",
"(",
"theProviders",
",",
"\"theProviders must not contain any null elements\"",
")",
";",
"myProviderRegistrationMutex",
".",
"lock",
"... | Register a group of theProviders. These could be Resource Providers, "plain" theProviders or a mixture of the two.
@param theProviders a {@code Collection} of theProviders. The parameter could be null or an empty {@code Collection} | [
"Register",
"a",
"group",
"of",
"theProviders",
".",
"These",
"could",
"be",
"Resource",
"Providers",
"plain",
"theProviders",
"or",
"a",
"mixture",
"of",
"the",
"two",
"."
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java#L1426-L1446 |
22,496 | jamesagnew/hapi-fhir | hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java | RestfulServer.setProviders | public void setProviders(Object... theProviders) {
Validate.noNullElements(theProviders, "theProviders must not contain any null elements");
myPlainProviders.clear();
if (theProviders != null) {
myPlainProviders.addAll(Arrays.asList(theProviders));
}
} | java | public void setProviders(Object... theProviders) {
Validate.noNullElements(theProviders, "theProviders must not contain any null elements");
myPlainProviders.clear();
if (theProviders != null) {
myPlainProviders.addAll(Arrays.asList(theProviders));
}
} | [
"public",
"void",
"setProviders",
"(",
"Object",
"...",
"theProviders",
")",
"{",
"Validate",
".",
"noNullElements",
"(",
"theProviders",
",",
"\"theProviders must not contain any null elements\"",
")",
";",
"myPlainProviders",
".",
"clear",
"(",
")",
";",
"if",
"("... | Sets the non-resource specific providers which implement method calls on this server
@see #setResourceProviders(Collection) | [
"Sets",
"the",
"non",
"-",
"resource",
"specific",
"providers",
"which",
"implement",
"method",
"calls",
"on",
"this",
"server"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java#L1612-L1619 |
22,497 | jamesagnew/hapi-fhir | hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java | RestfulServer.unregisterInterceptor | @Deprecated
public void unregisterInterceptor(Object theInterceptor) {
Validate.notNull(theInterceptor, "Interceptor can not be null");
getInterceptorService().unregisterInterceptor(theInterceptor);
} | java | @Deprecated
public void unregisterInterceptor(Object theInterceptor) {
Validate.notNull(theInterceptor, "Interceptor can not be null");
getInterceptorService().unregisterInterceptor(theInterceptor);
} | [
"@",
"Deprecated",
"public",
"void",
"unregisterInterceptor",
"(",
"Object",
"theInterceptor",
")",
"{",
"Validate",
".",
"notNull",
"(",
"theInterceptor",
",",
"\"Interceptor can not be null\"",
")",
";",
"getInterceptorService",
"(",
")",
".",
"unregisterInterceptor",... | Unregisters an interceptor
@param theInterceptor The interceptor
@deprecated As of HAPI FHIR 3.8.0, use {@link #getInterceptorService()} to access the interceptor service. You can register and unregister interceptors using this service. | [
"Unregisters",
"an",
"interceptor"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java#L1645-L1649 |
22,498 | jamesagnew/hapi-fhir | hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/SubscriptionMatcherInterceptor.java | SubscriptionMatcherInterceptor.submitResourceModified | @Override
public void submitResourceModified(final ResourceModifiedMessage theMsg) {
/*
* We only want to submit the message to the processing queue once the
* transaction is committed. We do this in order to make sure that the
* data is actually in the DB, in case it's the database matcher.
*/
if (Tra... | java | @Override
public void submitResourceModified(final ResourceModifiedMessage theMsg) {
/*
* We only want to submit the message to the processing queue once the
* transaction is committed. We do this in order to make sure that the
* data is actually in the DB, in case it's the database matcher.
*/
if (Tra... | [
"@",
"Override",
"public",
"void",
"submitResourceModified",
"(",
"final",
"ResourceModifiedMessage",
"theMsg",
")",
"{",
"/*\n\t\t * We only want to submit the message to the processing queue once the\n\t\t * transaction is committed. We do this in order to make sure that the\n\t\t * data is ... | This is an internal API - Use with caution! | [
"This",
"is",
"an",
"internal",
"API",
"-",
"Use",
"with",
"caution!"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/SubscriptionMatcherInterceptor.java#L125-L147 |
22,499 | jamesagnew/hapi-fhir | hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/Template.java | Template.parse | public static Template parse(String input) {
return new Template(input, Tag.getTags(), Filter.getFilters());
} | java | public static Template parse(String input) {
return new Template(input, Tag.getTags(), Filter.getFilters());
} | [
"public",
"static",
"Template",
"parse",
"(",
"String",
"input",
")",
"{",
"return",
"new",
"Template",
"(",
"input",
",",
"Tag",
".",
"getTags",
"(",
")",
",",
"Filter",
".",
"getFilters",
"(",
")",
")",
";",
"}"
] | Returns a new Template instance from a given input string.
@param input
the input string holding the Liquid source.
@return a new Template instance from a given input string. | [
"Returns",
"a",
"new",
"Template",
"instance",
"from",
"a",
"given",
"input",
"string",
"."
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/Template.java#L123-L125 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.