Override breakes stuff here for Kotlin
This commit is contained in:
parent
61adf61fc0
commit
c337fdde14
|
@ -50,14 +50,12 @@ public interface IAnyResource extends IBaseResource {
|
||||||
|
|
||||||
String getId();
|
String getId();
|
||||||
|
|
||||||
@Override
|
|
||||||
IIdType getIdElement();
|
IIdType getIdElement();
|
||||||
|
|
||||||
IPrimitiveType<String> getLanguageElement();
|
IPrimitiveType<String> getLanguageElement();
|
||||||
|
|
||||||
Object getUserData(String name);
|
Object getUserData(String name);
|
||||||
|
|
||||||
@Override
|
|
||||||
IAnyResource setId(String theId);
|
IAnyResource setId(String theId);
|
||||||
|
|
||||||
void setUserData(String name, Object value);
|
void setUserData(String name, Object value);
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
package cn.uhn.fhir.jaxrs.server.example
|
|
||||||
|
|
||||||
import ca.uhn.fhir.model.api.annotation.ResourceDef
|
|
||||||
import org.hl7.fhir.dstu3.model.BaseResource
|
|
||||||
import org.hl7.fhir.dstu3.model.Organization
|
|
||||||
import org.hl7.fhir.instance.model.api.IIdType
|
|
||||||
|
|
||||||
@ResourceDef(name = "Organization")
|
|
||||||
open class ExtendedOrganization : Organization() {
|
|
||||||
|
|
||||||
override fun setId(value: IIdType?): BaseResource? {
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -8,7 +8,7 @@ import ca.uhn.fhir.rest.annotation.OptionalParam
|
||||||
import ca.uhn.fhir.rest.annotation.Search
|
import ca.uhn.fhir.rest.annotation.Search
|
||||||
import ca.uhn.fhir.rest.api.Constants
|
import ca.uhn.fhir.rest.api.Constants
|
||||||
import ca.uhn.fhir.rest.param.StringParam
|
import ca.uhn.fhir.rest.param.StringParam
|
||||||
import org.hl7.fhir.instance.model.api.IAnyResource
|
import org.hl7.fhir.dstu3.model.Organization
|
||||||
import javax.ejb.Stateless
|
import javax.ejb.Stateless
|
||||||
import javax.ws.rs.Path
|
import javax.ws.rs.Path
|
||||||
import javax.ws.rs.Produces
|
import javax.ws.rs.Produces
|
||||||
|
@ -17,19 +17,17 @@ import javax.ws.rs.core.MediaType
|
||||||
@Path("Organization")
|
@Path("Organization")
|
||||||
@Stateless
|
@Stateless
|
||||||
@Produces(MediaType.APPLICATION_JSON, Constants.CT_FHIR_JSON, Constants.CT_FHIR_XML)
|
@Produces(MediaType.APPLICATION_JSON, Constants.CT_FHIR_JSON, Constants.CT_FHIR_XML)
|
||||||
class ExtendedOrganizationResource : BaseResource<ExtendedOrganization>() {
|
class ExtendedOrganizationResource : AbstractJaxRsResourceProvider<Organization>(FhirContext.forDstu3()) {
|
||||||
override fun getResourceType(): Class<ExtendedOrganization>? = ExtendedOrganization::class.java
|
override fun getResourceType(): Class<Organization>? = Organization::class.java
|
||||||
|
|
||||||
@Search
|
@Search
|
||||||
fun find(
|
fun find(
|
||||||
@OptionalParam(name = "_id") theId: StringParam?,
|
@OptionalParam(name = "_id") theId: StringParam?,
|
||||||
@IncludeParam(allow = ["Patient:general-practitioner"]) includes: Collection<Include>?
|
@IncludeParam(allow = ["Patient:general-practitioner"]) includes: Collection<Include>?
|
||||||
): List<ExtendedOrganization> {
|
): List<Organization> {
|
||||||
val organization = ExtendedOrganization().also {
|
val organization = Organization().also {
|
||||||
it.id = "id"
|
it.id = "id"
|
||||||
}
|
}
|
||||||
return listOf(organization)
|
return listOf(organization)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class BaseResource<T: IAnyResource>: AbstractJaxRsResourceProvider<T>(FhirContext.forDstu3())
|
|
||||||
|
|
Loading…
Reference in New Issue