本文整理汇总了C#中PAS.AutoTest.PasATCore.XMLParameter.GetParameterName方法的典型用法代码示例。如果您正苦于以下问题:C# XMLParameter.GetParameterName方法的具体用法?C# XMLParameter.GetParameterName怎么用?C# XMLParameter.GetParameterName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PAS.AutoTest.PasATCore.XMLParameter
的用法示例。
在下文中一共展示了XMLParameter.GetParameterName方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run_Patient_SetPatient_Normal_Case34
//Case 34: 1.3.1_SetPatient_Normal
public void Run_Patient_SetPatient_Normal_Case34()
{
int runCount = 0;
int matchItem = 1;
string patientUID = string.Empty;
bool isCreatePatient = false;
foreach (InputDataSet ids in this.Input.DataSets)
{
isCreatePatient = false;
runCount++;
Round r = this.NewRound(runCount.ToString(), "set patient");
CheckPoint pCreate = new CheckPoint("Create Patient", "Test create");
r.CheckPoints.Add(pCreate);
PatientService ps = new PatientService();
XMLParameter cpatientData = new XMLParameter("patient");
XMLParameter spatientData = new XMLParameter("patient");
for (int i = 0; i < ids.InputParameters.Count; i++)
{
if (ids.InputParameters.GetParameter(i).Step == "create")
{
cpatientData.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
isCreatePatient = true;
}
if (ids.InputParameters.GetParameter(i).Step == "set")
{
spatientData.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
matchItem++;
}
}
if (isCreatePatient)
{
XMLResult rslCreate = ps.createPatient(cpatientData);
if (!rslCreate.IsErrorOccured)
{
patientUID = rslCreate.SingleResult;
pCreate.Result = TestResult.Pass;
pCreate.Outputs.AddParameter("create", "Create patient UID", patientUID);
//System.Diagnostics.Debug.Print("PAS: Create patient UID:{0}",patientUID);
}
else
{
pCreate.Result = TestResult.Fail;
pCreate.Outputs.AddParameter("create", "Create patient ERR", rslCreate.Message);
//System.Diagnostics.Debug.Print("PAS: Create patient ERR:{0}",rslCreate.Message);
}
}
CheckPoint pSet = new CheckPoint("Set Patient", "Test set");
r.CheckPoints.Add(pSet);
XMLResult rslSet = ps.setPatient(spatientData, patientUID);
System.Threading.Thread.Sleep(500);
XMLResult rslGet = ps.getPatient(patientUID);
if (rslSet.IsErrorOccured || rslGet.IsErrorOccured)
{
pSet.Result = TestResult.Fail;
pSet.Outputs.AddParameter("set", "Set patient ERR", patientUID);
}
for (int j = 0; j < rslGet.ArrayResult.Length; j++)
{
for (int k = 0; k < spatientData.Length; k++)
{
if (rslGet.ArrayResult.GetParameterName(j) == spatientData.GetParameterName(k)
&& rslGet.ArrayResult.GetParameterValue(j) == spatientData.GetParameterValue(k))
matchItem--;
}
}
//System.Diagnostics.Debug.Print("PAS: Get patient match:{0}",matchItem - 1);
if (matchItem == 1)
{
pSet.Outputs.AddParameter("set", "Set patient OK", patientUID);
}
else
{
pSet.Result = TestResult.Fail;
pSet.Outputs.AddParameter("set", "Set patient ERR", rslSet.Message);
}
XMLResult delPat = ps.deletePatient(patientUID);
if (!delPat.IsErrorOccured)
{
pSet.Outputs.AddParameter("Delete created patient OK", "Delete Patient", delPat.Message);
pSet.Result = TestResult.Pass;
}
SaveRound(r);
}
Output();
}
示例2: Run_PS_GetPresentationStateDescription_PSNotExist_Case992
//Case 992: 1.3.7_GetPresentationStateDescription_N02_WhenPSNotExist
public void Run_PS_GetPresentationStateDescription_PSNotExist_Case992()
{
int runCount = 0;
string patientUID = string.Empty;
bool isCreatePatient = false;
bool isDeletePatient = false;
foreach (InputDataSet ids in this.Input.DataSets)
{
isCreatePatient = false;
isDeletePatient = false;
runCount++;
Round r = this.NewRound(runCount.ToString(), "Import image");
CheckPoint pCreate = new CheckPoint("Create Patient", "Test create");
r.CheckPoints.Add(pCreate);
PatientService ps = new PatientService();
ImportService ims = new ImportService();
PresentationStateService pss = new PresentationStateService();
XMLParameter pa = new XMLParameter("patient");
XMLParameter ia = new XMLParameter("import");
//XMLParameter psa = new XMLParameter("presentationstate");
for (int i = 0; i < ids.InputParameters.Count; i++)
{
if (ids.InputParameters.GetParameter(i).Step == "create")
{
pa.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
isCreatePatient = true;
}
if (ids.InputParameters.GetParameter(i).Step == "import")
{
ia.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
}
if (ids.InputParameters.GetParameter(i).Step == "delete")
{
isDeletePatient = true;
}
}
if (isCreatePatient)
{
XMLResult result = ps.createPatient(pa);
if (!result.IsErrorOccured)
{
patientUID = result.SingleResult;
pCreate.Result = TestResult.Pass;
pCreate.Outputs.AddParameter("create", "Create patient UID", patientUID);
}
}
CheckPoint pImport = new CheckPoint("Import Image", "Test import");
r.CheckPoints.Add(pImport);
string filePath = string.Empty;
string archivePath = string.Empty;
bool move = false;
for (int c = 0; c < ia.Length; c++)
{
if (ia.GetParameterName(c) == "path")
filePath = ia.GetParameterValue(c);
if (ia.GetParameterName(c) == "archivePath")
archivePath = ia.GetParameterValue(c);
if (ia.GetParameterName(c) == "move")
{
if (ia.GetParameterValue(c) == "true")
move = true;
}
}
XMLResult rslImport = ims.importObject(patientUID, "", filePath, archivePath, move, "false");
if (rslImport.IsErrorOccured)
{
pImport.Result = TestResult.Fail;
pImport.Outputs.AddParameter("import", "Import image fail", rslImport.Message);
pImport.Outputs.AddParameter("import", "Import image error code", rslImport.Code.ToString());
}
else
{
pImport.Result = TestResult.Pass;
pImport.Outputs.AddParameter("import", "Import image OK", rslImport.Message);
for (int findPs = 0; findPs < rslImport.MultiResults.Count; findPs++)
{
if (rslImport.MultiResults[findPs].Name == "presentationstate")
{
string psUID = rslImport.MultiResults[findPs].Parameters[0].ParameterValue;
XMLResult psreturn = pss.getPresentationState(psUID);
CheckPoint pGetPS = new CheckPoint("Get Presentation State", "PS Desc");
r.CheckPoints.Add(pGetPS);
if (psreturn.MultiResults.Count == 1 && !string.IsNullOrEmpty(psreturn.MultiResults[0].GetParameterValueByName("image_internal_id")) && string.IsNullOrEmpty(psreturn.MultiResults[0].GetParameterValueByName("general.xml")) && string.IsNullOrEmpty(psreturn.MultiResults[0].GetParameterValueByName("processing.xml")) && string.IsNullOrEmpty(psreturn.MultiResults[0].GetParameterValueByName("annotation.xml")))
{
pGetPS.Result = TestResult.Pass;
pGetPS.Outputs.AddParameter("get presentation state", "get presentation state as expect", psreturn.ResultContent);
}
else
{
pGetPS.Result = TestResult.Fail;
pGetPS.Outputs.AddParameter("get presentation state", "get presentation state not as expect", psreturn.ResultContent);
//.........这里部分代码省略.........
示例3: Run_WorkFlow_ImportCeph_RadioLog_Case1043
//Case 1043: 1.3.17_workflow_ImportCeph_GetImageInfo_RadilogIsNotSaved
public void Run_WorkFlow_ImportCeph_RadioLog_Case1043()
{
int runCount = 0;
string patientUID = string.Empty;
bool isCreatePatient = false;
bool isDeletePatient = true;
foreach (InputDataSet ids in this.Input.DataSets)
{
isCreatePatient = false;
runCount++;
Round r = this.NewRound(runCount.ToString(), "Import image");
PatientService patientSvc = new PatientService();
ImportService importSvc = new ImportService();
ImageService imageSvc = new ImageService();
string radioLogBeforeImport = string.Empty;
string radioLogAfterImport = string.Empty;
string imageID = null;
XMLParameter pa = new XMLParameter("patient");
XMLParameter ia = new XMLParameter("import");
for (int i = 0; i < ids.InputParameters.Count; i++)
{
if (ids.InputParameters.GetParameter(i).Step == "create")
{
pa.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
isCreatePatient = true;
}
if (ids.InputParameters.GetParameter(i).Step == "import")
{
ia.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
}
}
XMLParameter epGetImagInfo = new XMLParameter();
for (int i = 0; i < ids.ExpectedValues.Count; i++)
{
if (ids.ExpectedValues.GetParameter(i).Step == "getImageInfo")
{
epGetImagInfo.AddParameter(ids.ExpectedValues.GetParameter(i).Key, ids.ExpectedValues.GetParameter(i).Value);
}
}
try
{
#region Step1: Create Image
if (isCreatePatient)
{
CheckPoint pCreate = new CheckPoint("Create Patient", "Test create");
r.CheckPoints.Add(pCreate);
XMLResult rtCreatePatient = patientSvc.createPatient(pa);
if (!rtCreatePatient.IsErrorOccured)
{
patientUID = rtCreatePatient.SingleResult;
pCreate.Outputs.AddParameter("Create patient UID", "Create Patient", patientUID);
pCreate.Result = TestResult.Pass;
}
}
#endregion
#region Step2: Get patient radio log info before import
CheckPoint cpGetPatientBeforeImport = new CheckPoint("GetPatient", "Get Patient Info before import image");
r.CheckPoints.Add(cpGetPatientBeforeImport);
XMLResult rtGetPatientBeforeImport = patientSvc.getPatient(patientUID);
if (rtGetPatientBeforeImport.IsErrorOccured)
{
cpGetPatientBeforeImport.Result = TestResult.Fail;
cpGetPatientBeforeImport.Outputs.AddParameter("Get Patient Info before import image returns error", "GetPatient", rtGetPatientBeforeImport.ResultContent);
}
else
{
cpGetPatientBeforeImport.Result = TestResult.Pass;
cpGetPatientBeforeImport.Outputs.AddParameter("Get Patient Info before import image returns ok", "GetPatient", rtGetPatientBeforeImport.ResultContent);
radioLogBeforeImport = rtGetPatientBeforeImport.MultiResults[0].GetParameterValueByName("cumulative_dose"); //get the cumulative_dose info
}
#endregion
#region Step3: Import Image
CheckPoint pImport = new CheckPoint("Import Image", "Test import");
r.CheckPoints.Add(pImport);
string filePath = string.Empty;
string archivePath = string.Empty;
bool move = false;
for (int c = 0; c < ia.Length; c++)
{
if (ia.GetParameterName(c) == "path")
{
filePath = ia.GetParameterValue(c);
}
else if (ia.GetParameterName(c) == "archivePath")
{
archivePath = ia.GetParameterValue(c);
}
else if (ia.GetParameterName(c) == "move")
//.........这里部分代码省略.........
示例4: Run_3D_ImportCSModel_GetVolumeInfo_Case1220
//Case 1220: 1.9.1_WorkFlow_N2_Import CS Model_GetVolumeInfo
public void Run_3D_ImportCSModel_GetVolumeInfo_Case1220()
{
int runCount = 0;
string patientUID = string.Empty;
bool isCreatePatient = false;
bool isDeletePatient = true;
foreach (InputDataSet ids in this.Input.DataSets)
{
isCreatePatient = false;
runCount++;
Round r = this.NewRound(runCount.ToString(), "Import image");
ImportService importSvc = new ImportService();
XMLParameter pCreatePatient = new XMLParameter("patient");
XMLParameter pImportImage = new XMLParameter("import");
for (int i = 0; i < ids.InputParameters.Count; i++)
{
if (ids.InputParameters.GetParameter(i).Step == "create")
{
pCreatePatient.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
isCreatePatient = true;
}
if (ids.InputParameters.GetParameter(i).Step == "import")
{
pImportImage.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
}
}
XMLParameter epGetVolumeInfo = new XMLParameter();
for (int i = 0; i < ids.ExpectedValues.Count; i++)
{
if (ids.ExpectedValues.GetParameter(i).Step == "getVolumeInfo")
{
epGetVolumeInfo.AddParameter(ids.ExpectedValues.GetParameter(i).Key, ids.ExpectedValues.GetParameter(i).Value);
}
}
try
{
PatientService patientSvc = new PatientService();
if (isCreatePatient)
{
CheckPoint pCreate = new CheckPoint("Create Patient", "Test create");
r.CheckPoints.Add(pCreate);
XMLResult result = patientSvc.createPatient(pCreatePatient);
if (!result.IsErrorOccured)
{
patientUID = result.SingleResult;
pCreate.Result = TestResult.Pass;
pCreate.Outputs.AddParameter("Create patient UID", "Create Patient", patientUID);
}
else
{
pCreate.Result = TestResult.Fail;
pCreate.Outputs.AddParameter("Create patient returns error", "Create Patient", result.ResultContent);
}
}
CheckPoint cpImport = new CheckPoint("Import Image", "Test import");
r.CheckPoints.Add(cpImport);
string filePath = string.Empty;
string archivePath = string.Empty;
bool overrideExisted = false;
for (int c = 0; c < pImportImage.Length; c++)
{
if (pImportImage.GetParameterName(c) == "path")
filePath = pImportImage.GetParameterValue(c);
if (pImportImage.GetParameterName(c) == "archivePath")
archivePath = pImportImage.GetParameterValue(c);
if (pImportImage.GetParameterName(c) == "move")
{
if (pImportImage.GetParameterValue(c) == "true")
overrideExisted = true;
}
}
XMLResult rtlImport = importSvc.importObject(patientUID, "", filePath, archivePath, overrideExisted, "false");
/**********************************************
import return sample:
- <trophy type="result" version="1.0">
<status code="0" message="ok" />
- <volume>
<parameter key="internal_id" value="5412d81a-c096-4b0d-ab93-524266af21b6" />
</volume>
</trophy>
* **********************************************/
if (rtlImport.IsErrorOccured)
{
cpImport.Result = TestResult.Fail;
cpImport.Outputs.AddParameter("Import volume fail", "Import", rtlImport.Message);
cpImport.Outputs.AddParameter("Import volume returns error code", "Import", rtlImport.Code.ToString());
}
else
{
//.........这里部分代码省略.........
示例5: Run_Import_Zip_Case512
//Case 512: 1.2.3_ImportZip_Normal
public void Run_Import_Zip_Case512()
{
int runCount = 0;
string patientUID = string.Empty;
bool isCreatePatient = false;
bool isDeletePatient = false;
foreach (InputDataSet ids in this.Input.DataSets)
{
isCreatePatient = false;
isDeletePatient = false;
runCount++;
Round r = this.NewRound(runCount.ToString(), "Import image");
CheckPoint pCreate = new CheckPoint("Create Patient", "Test create");
r.CheckPoints.Add(pCreate);
PatientService ps = new PatientService();
ImportService ims = new ImportService();
PresentationStateService pss = new PresentationStateService();
XMLParameter pa = new XMLParameter("patient");
XMLParameter ia = new XMLParameter("import");
XMLParameter ObjFilter = new XMLParameter("filter");
for (int i = 0; i < ids.InputParameters.Count; i++)
{
if (ids.InputParameters.GetParameter(i).Step == "create")
{
pa.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
isCreatePatient = true;
}
if (ids.InputParameters.GetParameter(i).Step == "import")
{
ia.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
}
if (ids.InputParameters.GetParameter(i).Step == "delete")
{
isDeletePatient = true;
}
}
if (isCreatePatient)
{
XMLResult result = ps.createPatient(pa);
if (!result.IsErrorOccured)
{
patientUID = result.SingleResult;
pCreate.Outputs.AddParameter("create", "Create patient UID", patientUID);
pCreate.Result = TestResult.Pass;
}
}
CheckPoint pImport = new CheckPoint("Import Image", "Test import");
r.CheckPoints.Add(pImport);
string filePath = string.Empty;
string archivePath = string.Empty;
bool move = false;
for (int c = 0; c < ia.Length; c++)
{
if (ia.GetParameterName(c) == "path")
filePath = ia.GetParameterValue(c);
if (ia.GetParameterName(c) == "archivePath")
archivePath = ia.GetParameterValue(c);
if (ia.GetParameterName(c) == "move")
{
if (ia.GetParameterValue(c) == "true")
move = true;
}
}
XMLResult rslImport = ims.importObject(patientUID, "", filePath, archivePath, move, "false");
if (rslImport.IsErrorOccured)
{
pImport.Result = TestResult.Fail;
pImport.Outputs.AddParameter("import", "Import image fail", rslImport.Message);
pImport.Outputs.AddParameter("import", "Import image error code", rslImport.Code.ToString());
}
else
{
pImport.Result = TestResult.Pass;
pImport.Outputs.AddParameter("import", "Import image OK", rslImport.Message);
ObjFilter.AddParameter("patient_internal_id", patientUID);
ObjFilter.AddParameter("type", "presentationstate");
ObjFilter.AddParameter("current", "true");
XMLResult listObjcetRsl = ps.listObjects(ObjFilter);
CheckPoint pListObject = new CheckPoint("List Image", "Test list object");
r.CheckPoints.Add(pListObject);
if (listObjcetRsl.IsErrorOccured)
{
pListObject.Result = TestResult.Fail;
pListObject.Outputs.AddParameter("Erron in List Object", "List Object", "List Patient Presentation State Error");
}
else
{
pListObject.Outputs.AddParameter("List Object return content", "List Object", listObjcetRsl.ResultContent);
if (listObjcetRsl.ArrayResult.Length == 3)
{
bool isMatchXML = true;
for (int index = 0; index < listObjcetRsl.ArrayResult.Parameters.Count; index++)
//.........这里部分代码省略.........
示例6: Run_Import_ArchivedImage_Case721
// Case 721: 1.3.10_ImportImage_N02_Archived image
public void Run_Import_ArchivedImage_Case721()
{
int runCount = 0;
string patientUID = string.Empty;
bool isCreatePatient = false;
bool isDeletePatient = true;
foreach (InputDataSet ids in this.Input.DataSets)
{
isCreatePatient = false;
runCount++;
Round r = this.NewRound(runCount.ToString(), "Import image");
ImportService ims = new ImportService();
XMLParameter pa = new XMLParameter("patient");
XMLParameter ia = new XMLParameter("import");
for (int i = 0; i < ids.InputParameters.Count; i++)
{
if (ids.InputParameters.GetParameter(i).Step == "create")
{
pa.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
isCreatePatient = true;
}
if (ids.InputParameters.GetParameter(i).Step == "import")
{
ia.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
}
}
XMLParameter epGetImagInfo = new XMLParameter();
XMLParameter epGetImageDescription = new XMLParameter();
for (int i = 0; i < ids.ExpectedValues.Count; i++)
{
if (ids.ExpectedValues.GetParameter(i).Step == "getImageInfo")
{
epGetImagInfo.AddParameter(ids.ExpectedValues.GetParameter(i).Key, ids.ExpectedValues.GetParameter(i).Value);
}
else if (ids.ExpectedValues.GetParameter(i).Step == "getImageDescription")
{
epGetImageDescription.AddParameter(ids.ExpectedValues.GetParameter(i).Key, ids.ExpectedValues.GetParameter(i).Value);
}
}
try
{
PatientService patientSvc = new PatientService();
if (isCreatePatient)
{
CheckPoint pCreate = new CheckPoint("Create Patient", "Test create");
r.CheckPoints.Add(pCreate);
XMLResult result = patientSvc.createPatient(pa);
if (!result.IsErrorOccured)
{
patientUID = result.SingleResult;
pCreate.Result = TestResult.Pass;
pCreate.Outputs.AddParameter("Create patient UID", "Create Patient", patientUID);
}
else
{
pCreate.Result = TestResult.Fail;
pCreate.Outputs.AddParameter("Create patient returns error", "Create Patient", result.ResultContent);
}
}
CheckPoint pImport = new CheckPoint("Import Image", "Test import");
r.CheckPoints.Add(pImport);
string filePath = string.Empty;
string archivePath = string.Empty;
bool move = false;
for (int c = 0; c < ia.Length; c++)
{
if (ia.GetParameterName(c) == "path")
filePath = ia.GetParameterValue(c);
if (ia.GetParameterName(c) == "archivePath")
archivePath = ia.GetParameterValue(c);
if (ia.GetParameterName(c) == "move")
{
if (ia.GetParameterValue(c) == "true")
move = true;
}
}
XMLResult rslImport = ims.importObject(patientUID, "", filePath, archivePath, move, "false");
//import return sample:
// <trophy type="result" version="1.0">
// <status code="0" message="ok" />
// <image><parameter key="internal_id" value="2bfb416b-037e-41e7-aaef-8d2bd08b1ae7" /></image>
// <presentationstate><parameter key="internal_id" value="75675345-a164-4088-b6d3-1b2ae86b703b" /></presentationstate>
// </trophy>
if (rslImport.IsErrorOccured)
{
pImport.Result = TestResult.Fail;
pImport.Outputs.AddParameter("Import image fail", "Import", rslImport.Message);
pImport.Outputs.AddParameter("Import image returns error code", "Import", rslImport.Code.ToString());
}
//.........这里部分代码省略.........
示例7: Run_Import_TW5Tiff_Case1048
// Case 1048: 1.3.10_ImportImage_N05_TW5Tiff_FMS
public void Run_Import_TW5Tiff_Case1048()
{
int runCount = 0;
string patientUID = string.Empty;
bool isCreatePatient = false;
bool isDeletePatient = true;
foreach (InputDataSet ids in this.Input.DataSets)
{
isCreatePatient = false;
runCount++;
Round r = this.NewRound(runCount.ToString(), "Import image");
ImportService ims = new ImportService();
XMLParameter pa = new XMLParameter("patient");
XMLParameter ia = new XMLParameter("import");
for (int i = 0; i < ids.InputParameters.Count; i++)
{
if (ids.InputParameters.GetParameter(i).Step == "create")
{
pa.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
isCreatePatient = true;
}
if (ids.InputParameters.GetParameter(i).Step == "import")
{
ia.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
}
}
XMLParameter epImport = new XMLParameter();
for (int i = 0; i < ids.ExpectedValues.Count; i++)
{
if (ids.ExpectedValues.GetParameter(i).Step == "import")
{
epImport.AddParameter(ids.ExpectedValues.GetParameter(i).Key, ids.ExpectedValues.GetParameter(i).Value);
}
}
try
{
PatientService patientSvc = new PatientService();
if (isCreatePatient)
{
CheckPoint pCreate = new CheckPoint("Create Patient", "Test create");
r.CheckPoints.Add(pCreate);
XMLResult result = patientSvc.createPatient(pa);
if (!result.IsErrorOccured)
{
patientUID = result.SingleResult;
pCreate.Result = TestResult.Pass;
pCreate.Outputs.AddParameter("Create patient UID", "Create Patient", patientUID);
}
else
{
pCreate.Result = TestResult.Fail;
pCreate.Outputs.AddParameter("Create patient returns error", "Create Patient", result.ResultContent);
}
}
CheckPoint pImport = new CheckPoint("Import Image", "Test import");
r.CheckPoints.Add(pImport);
string filePath = string.Empty;
string archivePath = string.Empty;
bool move = false;
for (int c = 0; c < ia.Length; c++)
{
if (ia.GetParameterName(c) == "path")
filePath = ia.GetParameterValue(c);
if (ia.GetParameterName(c) == "archivePath")
archivePath = ia.GetParameterValue(c);
if (ia.GetParameterName(c) == "move")
{
if (ia.GetParameterValue(c) == "true")
move = true;
}
}
XMLResult rslImport = ims.importObject(patientUID, "", filePath, archivePath, move, "false");
/************************************************
import return sample:
- <trophy type="result" version="1.0">
<status code="0" message="ok" />
- <fms>
<parameter key="internal_id" value="79d96c5c-1ec5-4408-8709-622c0bd4a951" />
</fms>
- <image>
<parameter key="internal_id" value="1547aca3-7d98-4282-bd4c-e4e9547e126b" />
</image>
- <presentationstate>
<parameter key="internal_id" value="f0c4ed26-e41f-45dc-9f03-41e982d70b23" />
</presentationstate>
- <image>
<parameter key="internal_id" value="14831be6-ca69-417c-957f-c7f3a493cc70" />
</image>
- <presentationstate>
<parameter key="internal_id" value="a640fe70-7ad9-45c4-b68c-1f0ba2c503f1" />
</presentationstate>
//.........这里部分代码省略.........
示例8: Run_Import_TestNotification_Case981
//Case 981: 1.3.10_ImportImage_N01_WithNotification
public void Run_Import_TestNotification_Case981()
{
int runCount = 0;
string patientUID = string.Empty;
bool isCreatePatient = false;
bool isDeletePatient = false;
string stopMessageType = "teststop";
string stopMessageContent = "teststop";
//LaunchNotification();
NotificationSim.ReceiveNotification rn = new NotificationSim.ReceiveNotification();
//NotificationSim.ReceiveNotification rn = new NotificationSim.ReceiveNotification("10.112.39.167");
System.Collections.Generic.List<string> rms = new System.Collections.Generic.List<string>();
rms.Add("topic.patientCreated");
rms.Add("topic.acquisitionCompleted");
rms.Add("topic.imageCreated");
rms.Add("topic.presentationStateModified");
rn.startListon(rms, stopMessageType, stopMessageContent);
foreach (InputDataSet ids in this.Input.DataSets)
{
isCreatePatient = false;
isDeletePatient = false;
runCount++;
Round r = this.NewRound(runCount.ToString(), "Import image");
CheckPoint pCreate = new CheckPoint("Create Patient", "Test create");
r.CheckPoints.Add(pCreate);
PatientService ps = new PatientService();
ImportService ims = new ImportService();
ApplicationService ass = new ApplicationService();
XMLParameter pa = new XMLParameter("patient");
XMLParameter ia = new XMLParameter("import");
for (int i = 0; i < ids.InputParameters.Count; i++)
{
if (ids.InputParameters.GetParameter(i).Step == "create")
{
pa.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
isCreatePatient = true;
}
if (ids.InputParameters.GetParameter(i).Step == "import")
{
ia.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
}
if (ids.InputParameters.GetParameter(i).Step == "delete")
{
isDeletePatient = true;
}
}
if (isCreatePatient)
{
XMLResult result = ps.createPatient(pa);
if (!result.IsErrorOccured)
{
patientUID = result.SingleResult;
pCreate.Result = TestResult.Pass;
pCreate.Outputs.AddParameter("create", "Create patient UID", patientUID);
}
}
System.Threading.Thread.Sleep(500);
CheckPoint pImport = new CheckPoint("Import Image", "Test import");
r.CheckPoints.Add(pImport);
string filePath = string.Empty;
string archivePath = string.Empty;
for (int c = 0; c < ia.Length; c++)
{
if (ia.GetParameterName(c) == "path")
filePath = ia.GetParameterValue(c);
if (ia.GetParameterName(c) == "archivepath")
archivePath = ia.GetParameterValue(c);
}
XMLResult rslImport = ims.importObject(patientUID, "", filePath, archivePath, true, "false");
if (rslImport.IsErrorOccured)
{
pImport.Result = TestResult.Fail;
pImport.Outputs.AddParameter("import", "Import image fail", rslImport.Message);
pImport.Outputs.AddParameter("import", "Import image error code", rslImport.Code.ToString());
}
else
{
pImport.Result = TestResult.Pass;
pImport.Outputs.AddParameter("import", "Import image OK", rslImport.Message);
}
System.Threading.Thread.Sleep(500);
ass.sendGenericNotification(stopMessageType, stopMessageContent);
System.Threading.Thread.Sleep(500);
int getn = rn.getNotificationNumber();
CheckPoint pNotification = new CheckPoint("Receive Notification", "import message");
r.CheckPoints.Add(pNotification);
if (getn == 3)
{
pNotification.Result = TestResult.Pass;
foreach (string mmm in rn.getNotificationContent())
//.........这里部分代码省略.........
示例9: Run_Import_SimpleInstance_LargeFile_Case1658
// Case 1658: 1.2.3_ImportImage_SimpleInstance_large file
public void Run_Import_SimpleInstance_LargeFile_Case1658()
{
int runCount = 0;
string patientUID = string.Empty;
bool isCreatePatient = false;
bool isDeletePatient = true;
foreach (InputDataSet ids in this.Input.DataSets)
{
isCreatePatient = false;
runCount++;
Round r = this.NewRound(runCount.ToString(), "Import image");
string instanceID = null;
PatientService ps = new PatientService();
ImportService ims = new ImportService();
XMLParameter pa = new XMLParameter("patient");
XMLParameter ia = new XMLParameter("import");
for (int i = 0; i < ids.InputParameters.Count; i++)
{
if (ids.InputParameters.GetParameter(i).Step == "create")
{
pa.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
isCreatePatient = true;
}
if (ids.InputParameters.GetParameter(i).Step == "import")
{
ia.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
}
}
XMLParameter epGetInstanceInfo = new XMLParameter();
for (int i = 0; i < ids.ExpectedValues.Count; i++)
{
if (ids.ExpectedValues.GetParameter(i).Step == "getInstanceInfo")
{
epGetInstanceInfo.AddParameter(ids.ExpectedValues.GetParameter(i).Key, ids.ExpectedValues.GetParameter(i).Value);
}
}
try
{
if (isCreatePatient)
{
CheckPoint pCreate = new CheckPoint("Create Patient", "Test create");
r.CheckPoints.Add(pCreate);
XMLResult result = ps.createPatient(pa);
if (!result.IsErrorOccured)
{
patientUID = result.SingleResult;
pCreate.Result = TestResult.Pass;
pCreate.Outputs.AddParameter("Create patient UID", "Create Patient", patientUID);
}
}
CheckPoint pImport = new CheckPoint("Import Image", "Test import");
r.CheckPoints.Add(pImport);
string filePath = string.Empty;
string archivePath = string.Empty;
bool move = false;
for (int c = 0; c < ia.Length; c++)
{
if (ia.GetParameterName(c) == "path")
filePath = ia.GetParameterValue(c);
if (ia.GetParameterName(c) == "archivePath")
archivePath = ia.GetParameterValue(c);
if (ia.GetParameterName(c) == "move")
{
if (ia.GetParameterValue(c) == "true")
move = true;
}
}
XMLResult rslImport = ims.importObject(patientUID, "", filePath, archivePath, move, "false");
/*****************************************
* import simple instance return sample:
* <trophy type="result" version="1.0">
* <status code="0" message="ok" />
* <instance><parameter key="internal_id" value="1f678090-2c54-4128-8d13-833645ac7483" /></instance>
* </trophy>
* ****************************************/
if (rslImport.IsErrorOccured)
{
pImport.Result = TestResult.Fail;
pImport.Outputs.AddParameter("Import simple instance fail", "Import", rslImport.Message);
pImport.Outputs.AddParameter("Import simple instance returns error code", "Import", rslImport.Code.ToString());
}
else
{
// Check the return contiains instance id
instanceID = rslImport.MultiResults[0].GetParameterValueByName("internal_id"); // image internal_id
if (instanceID == null || instanceID == string.Empty)
{
pImport.Result = TestResult.Fail;
pImport.Outputs.AddParameter("Import simple instance returns wrong instance internal id", "Import", rslImport.ResultContent);
//.........这里部分代码省略.........
示例10: Run_Import_8100Slice_Case1203
//.........这里部分代码省略.........
}
}
try
{
PatientService patientSvc = new PatientService();
if (isCreatePatient)
{
CheckPoint pCreate = new CheckPoint("Create Patient", "Test create");
r.CheckPoints.Add(pCreate);
XMLResult result = patientSvc.createPatient(pa);
if (!result.IsErrorOccured)
{
patientUID = result.SingleResult;
pCreate.Result = TestResult.Pass;
pCreate.Outputs.AddParameter("Create patient UID", "Create Patient", patientUID);
}
else
{
pCreate.Result = TestResult.Fail;
pCreate.Outputs.AddParameter("Create patient returns error", "Create Patient", result.ResultContent);
}
}
CheckPoint pImport = new CheckPoint("Import Image", "Test import");
r.CheckPoints.Add(pImport);
string filePath = string.Empty;
string archivePath = string.Empty;
bool move = false;
for (int c = 0; c < ia.Length; c++)
{
if (ia.GetParameterName(c) == "path")
filePath = ia.GetParameterValue(c);
if (ia.GetParameterName(c) == "archivePath")
archivePath = ia.GetParameterValue(c);
if (ia.GetParameterName(c) == "move")
{
if (ia.GetParameterValue(c) == "true")
move = true;
}
}
XMLResult rslImport = ims.importObject(patientUID, "", filePath, archivePath, move, "false");
//import return sample:
// <trophy type="result" version="1.0">
// <status code="0" message="ok" />
// <image><parameter key="internal_id" value="2bfb416b-037e-41e7-aaef-8d2bd08b1ae7" /></image>
// <presentationstate><parameter key="internal_id" value="75675345-a164-4088-b6d3-1b2ae86b703b" /></presentationstate>
// </trophy>
if (rslImport.IsErrorOccured)
{
pImport.Result = TestResult.Fail;
pImport.Outputs.AddParameter("Import image fail", "Import", rslImport.Message);
pImport.Outputs.AddParameter("Import image returns error code", "Import", rslImport.Code.ToString());
}
else
{
// Check the return contiains image id and ps id
string imageID = null;
imageID = rslImport.MultiResults[0].GetParameterValueByName("internal_id"); // image internal_id
if (imageID == null || imageID == string.Empty)
{
示例11: Run_Import_FMS_Case1496
// Case 1496: 1.2.3_ImportImage_FMS
public void Run_Import_FMS_Case1496()
{
int runCount = 0;
string patientUID = string.Empty;
bool isCreatePatient = false;
bool isDeletePatient = true;
foreach (InputDataSet ids in this.Input.DataSets)
{
isCreatePatient = false;
runCount++;
Round r = this.NewRound(runCount.ToString(), "Import image");
CheckPoint pCreate = new CheckPoint("Create Patient", "Test create");
r.CheckPoints.Add(pCreate);
PatientService ps = new PatientService();
ImportService ims = new ImportService();
XMLParameter pa = new XMLParameter("patient");
XMLParameter ia = new XMLParameter("import");
for (int i = 0; i < ids.InputParameters.Count; i++)
{
if (ids.InputParameters.GetParameter(i).Step == "create")
{
pa.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
isCreatePatient = true;
}
if (ids.InputParameters.GetParameter(i).Step == "import")
{
ia.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
}
}
string ep_nodeNum = string.Empty;
string ep_totalSubImageNum = string.Empty;
string ep_successImageNum = string.Empty;
for (int i = 0; i < ids.ExpectedValues.Count; i++)
{
if (ids.ExpectedValues.GetParameter(i).Step == "import")
{
if (ids.ExpectedValues.GetParameter(i).Key == "node")
{
ep_nodeNum = ids.ExpectedValues.GetParameter(i).Value;
}
else if (ids.ExpectedValues.GetParameter(i).Key == "total")
{
ep_totalSubImageNum = ids.ExpectedValues.GetParameter(i).Value;
}
else if (ids.ExpectedValues.GetParameter(i).Key == "success")
{
ep_successImageNum = ids.ExpectedValues.GetParameter(i).Value;
}
}
}
XMLParameter epGetFMSInfo = new XMLParameter();
//XMLParameter epGetFMSDescription = new XMLParameter();
for (int i = 0; i < ids.ExpectedValues.Count; i++)
{
if (ids.ExpectedValues.GetParameter(i).Step == "getFMSInfo")
{
epGetFMSInfo.AddParameter(ids.ExpectedValues.GetParameter(i).Key, ids.ExpectedValues.GetParameter(i).Value);
}
//else if (ids.ExpectedValues.GetParameter(i).Step == "getFMSDescription")
//{
// epGetFMSDescription.AddParameter(ids.ExpectedValues.GetParameter(i).Key, ids.ExpectedValues.GetParameter(i).Value);
//}
}
try
{
if (isCreatePatient)
{
XMLResult result = ps.createPatient(pa);
if (!result.IsErrorOccured)
{
patientUID = result.SingleResult;
pCreate.Outputs.AddParameter("Create patient UID", "Create Patient", patientUID);
pCreate.Result = TestResult.Pass;
}
else
{
pCreate.Outputs.AddParameter("Create patient UID", "Create Patient Fail", result.ResultContent);
pCreate.Result = TestResult.Fail;
}
}
CheckPoint pImport = new CheckPoint("Import Image", "Test import");
r.CheckPoints.Add(pImport);
string filePath = string.Empty;
string archivePath = string.Empty;
bool move = false;
for (int c = 0; c < ia.Length; c++)
{
if (ia.GetParameterName(c) == "path")
filePath = ia.GetParameterValue(c);
if (ia.GetParameterName(c) == "archivePath")
archivePath = ia.GetParameterValue(c);
//.........这里部分代码省略.........