You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
result := loadCoded(params, loadType, issuePath, mode);
1852
+
result := loadCoded(params, cs, issuePath, mode);
1852
1853
finally
1853
1854
params.free;
1854
1855
end;
1855
1856
end
1856
1857
else
1857
1858
raise ETerminologyError.Create('Unable to find code to validate (looked for coding | codeableConcept | code+system | code+inferSystem in parameters ='+request.Parameters.Source+')', itNotFound);
1858
1859
end;
1859
-
1860
-
functionTFhirTerminologyOperation.loadCoded(params : TFHIRParametersW; loadType : TLoadCodedType; var issuePath : string; var mode : TValidationCheckMode): TFhirCodeableConceptW;
1860
+
1861
+
functionTFhirTerminologyOperation.loadCoded(params : TFHIRParametersW; cs : boolean; var issuePath : string; var mode : TValidationCheckMode): TFhirCodeableConceptW;
1861
1862
var
1862
1863
coding : TFhirCodingW;
1863
1864
begin
@@ -1879,7 +1880,7 @@ function TFhirTerminologyOperation.loadCoded(params : TFHIRParametersW; loadType
1879
1880
result := FFactory.wrapCodeableConcept(params.obj('codeableConcept').Link);
1880
1881
issuePath := 'CodeableConcept';
1881
1882
end
1882
-
elseif (params.has('code') and (params.has('system')) or ((loadType = lctVS) and (params.has('code') and (params.bool('inferSystem') or params.bool('implySystem'))))) then
1883
+
elseif (params.has('code') and (params.has('system')) or ((not cs) and (params.has('code') and (params.bool('inferSystem') or params.bool('implySystem'))))) then
1883
1884
begin
1884
1885
issuePath := '';
1885
1886
mode := vcmCode;
@@ -1899,7 +1900,7 @@ function TFhirTerminologyOperation.loadCoded(params : TFHIRParametersW; loadType
1899
1900
coding.free;
1900
1901
end;
1901
1902
end
1902
-
elseif (loadType = lctCS) and (params.has('code') and params.has('url')) then
1903
+
elseif (cs) and (params.has('code') and params.has('url')) then
1903
1904
begin
1904
1905
issuePath := '';
1905
1906
mode := vcmCode;
@@ -1916,27 +1917,102 @@ function TFhirTerminologyOperation.loadCoded(params : TFHIRParametersW; loadType
1916
1917
coding.free;
1917
1918
end;
1918
1919
end
1919
-
elseif (loadType = lctCMSrc) then
1920
+
else
1921
+
raise ETerminologyError.Create('Unable to find code to validate (looked for coding | codeableConcept | code in parameters ='+params.names+')', itNotFound);
1922
+
end;
1923
+
1924
+
functionTFhirTerminologyOperation.loadSourceCode(request : TFHIRRequest; var issuePath : string): TFhirCodeableConceptW;
1925
+
var
1926
+
coding : TFhirCodingW;
1927
+
params : TFhirParametersW;
1928
+
m : String;
1929
+
begin
1930
+
// ok, now we need to find the source code to translate
1931
+
if (request.form <> nil) and request.form.hasParam('sourceCoding') then
1920
1932
begin
1921
-
if params.has('sourceCode') and params.has('system') then
1922
-
begin
1923
-
result := FFactory.wrapCodeableConcept(fFactory.makeByName('CodeableConcept'));
1924
-
coding := result.addCoding;
1925
-
try
1933
+
result := FFactory.wrapCodeableConcept(fFactory.makeByName('CodeableConcept'));
1934
+
coding := FFactory.makeDtFromForm(request.form.getParam('sourceCoding'), request.langList, 'sourceCoding', 'Coding') as TFHIRCodingW;
1935
+
try
1936
+
result.addCoding(coding);
1937
+
finally
1938
+
coding.free;
1939
+
end;
1940
+
issuePath := 'sourceCoding';
1941
+
end
1942
+
elseif (request.form <> nil) and request.form.hasParam('sourceCodeableConcept') then
1943
+
begin
1944
+
result := FFactory.makeDtFromForm(request.form.getParam('sourceCodeableConcept'), request.langList, 'sourceCodeableConcept', 'CodeableConcept') as TFhirCodeableConceptW;
1945
+
issuePath := 'sourceCodeableConcept';
1946
+
end
1947
+
elseif request.Parameters.has('sourceCode') and (request.Parameters.has('sourceSystem') or request.Parameters.has('system')) then
1948
+
begin
1949
+
issuePath := '';
1950
+
result := FFactory.wrapCodeableConcept(fFactory.makeByName('CodeableConcept'));
raise ETerminologyError.Create('Unable to find code to translate (looked for sourceCoding | sourceCodeableConcept | sourceCode+sourceSystem in parameters ='+request.Parameters.Source+')', itNotFound);
1973
+
end;
1974
+
1975
+
functionTFhirTerminologyOperation.loadSourceCode(params : TFHIRParametersW; var issuePath : string): TFhirCodeableConceptW;
1976
+
var
1977
+
coding : TFhirCodingW;
1978
+
begin
1979
+
if params.obj('sourceCoding') <> nilthen
1980
+
begin
1981
+
result := FFactory.wrapCodeableConcept(fFactory.makeByName('CodeableConcept'));
result := FFactory.wrapCodeableConcept(params.obj('sourceCodeableConcept').Link);
1993
+
issuePath := 'CodeableConcept';
1994
+
end
1995
+
elseif params.has('sourceCode') and (params.has('sourceSystem') or params.has('system')) then
1996
+
begin
1997
+
issuePath := '';
1998
+
result := FFactory.wrapCodeableConcept(fFactory.makeByName('CodeableConcept'));
1999
+
coding := result.addCoding;
2000
+
try
2001
+
coding.systemUri := params.str('sourceSystem');
2002
+
if (coding.systemUri = '') and (params.str('system') <> '') then
1926
2003
coding.systemUri := params.str('system');
1927
-
coding.version := params.str('version');
1928
-
coding.code := params.str('sourceCode');
1929
-
finally
1930
-
coding.free;
1931
-
end;
1932
-
end
1933
-
else
1934
-
raise ETerminologyError.Create('Unable to find code to validate (looked for coding | codeableConcept | code in parameters ='+params.names+')', itNotFound);
2004
+
if params.has('systemVersion') then
2005
+
coding.version := params.str('systemVersion');
2006
+
coding.code := params.str('sourceCode');
2007
+
finally
2008
+
coding.free;
2009
+
end;
1935
2010
end
1936
2011
else
1937
-
raise ETerminologyError.Create('Unable to find code to validate (looked for coding | codeableConcept | code in parameters ='+params.names+')', itNotFound);
2012
+
raise ETerminologyError.Create('Unable to find code to translate (looked for sourceCoding | sourceCodeableConcept | sourceCode in parameters ='+params.names+')', itNotFound);
0 commit comments