| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575 |
- <?php
- require_once("common/SQLServerManager.php");
- require_once("common/SecurityManager.php");
- require_once('vo/com/imt/intimamedia/vo/ReturnObjectVo.php');
- require_once('vo/com/imt/intimamedia/vo/UltraSoundScannerVo.php');
- require_once('vo/com/imt/intimamedia/vo/ProbeVo.php');
- require_once('vo/com/imt/intimamedia/vo/DragAndDropVo.php');
- require_once('vo/com/imt/intimamedia/vo/MeasuresVo.php');
- require_once('vo/com/imt/intimamedia/vo/ImtResultVo.php');
- require_once('vo/com/imt/intimamedia/vo/ScaleVo.php');
- require_once('vo/com/imt/intimamedia/vo/DistanceVo.php');
- require_once('vo/com/imt/intimamedia/vo/AreaVo.php');
- define ('INSERT', 1);
- define ('UPDATE', 2);
- class MeasureService
- {
- public function persistMeasure($measureId, $imgId, $operation, $scale, $distance, $area, $area2, $imtf, $imtn, $ultraSoundScanner)
- {
- $transaction = SQLServerManager::startTransaction();
-
- $query = "SELECT fk_scale, fk_distance, fk_area, fk_area2, fk_imtf, fk_imtn FROM [intimamedia_physician].[dbo].[tj_measure] WHERE fk_image = ". $imgId;
-
- $results = SQLServerManager::queryOnDatabase( $query );
-
- $fk_scale = 0;
- $fk_distance = 0;
- $fk_area = 0;
- $fk_area2 = 0;
- $fk_imtf = 0;
- $fk_imtn = 0;
-
- $scaleId = 0;
- $distanceId = 0;
- $areaId = 0;
- $area2Id = 0;
- $imtfId = 0;
- $imtnId = 0;
- $ultraSoundScannerId = 0;
-
- foreach( $results as $val )
- {
- $fk_scale = $val->fk_scale;
- $fk_distance = $val->fk_distance;
- $fk_area = $val->fk_area;
- $fk_area2 = $val->fk_area2;
- $fk_imtf = $val->fk_imtf;
- $fk_imtn = $val->fk_imtn;
- }
-
- if ($scale)
- {
- if (!$fk_scale)
- {
- $scaleQuery = "INSERT INTO [intimamedia_physician].[dbo].[t_scale] (value, length, x_first_point, y_first_point, x_last_point, y_last_point) VALUES ".
- "(". $scale->value .", ". $scale->length .", ". $scale->xFirstPoint .", ". $scale->yFirstPoint .", ". $scale->xLastPoint .", ". $scale->yLastPoint .");";
-
- $scaleExecQuery = SQLServerManager::executeQueryForTransaction( $scaleQuery, $transaction );
-
- $scaleId = SQLServerManager::getLastId( "[intimamedia_physician].[dbo].[t_scale]", $transaction );
- }
- else
- // UPDATE
- {
- $scaleQuery = "UPDATE [intimamedia_physician].[dbo].[t_scale] SET value = ". $scale->value .", length = ". $scale->length .",
- x_first_point = ". $scale->xFirstPoint .", y_first_point = ". $scale->yFirstPoint .",
- x_last_point = ". $scale->xLastPoint .", y_last_point = ". $scale->yLastPoint . " WHERE id = ". $fk_scale .";";
-
- $scaleExecQuery = SQLServerManager::executeQueryForTransaction( $scaleQuery, $transaction );
-
- $scaleId = $fk_scale;
- }
- }
-
- if ($distance)
- {
- if (!$fk_distance)
- {
- $distanceQuery = "INSERT INTO [intimamedia_physician].[dbo].[t_distance] (value, type, x_first_point, y_first_point, x_last_point, y_last_point) VALUES ".
- "(". $distance->value .", '". $distance->type ."', ". $distance->xFirstPoint .", ". $distance->yFirstPoint .", ". $distance->xLastPoint .", ". $distance->yLastPoint .");";
-
- $distanceExecQuery = SQLServerManager::executeQueryForTransaction( $distanceQuery, $transaction );
-
- $distanceId = SQLServerManager::getLastId( "[intimamedia_physician].[dbo].[t_distance]", $transaction );
- }
- else
- // UPDATE
- {
- $distanceQuery = "UPDATE [intimamedia_physician].[dbo].[t_distance] SET value = ". $distance->value .", type = '". $distance->type ."',
- x_first_point = ". $distance->xFirstPoint .", y_first_point = ". $distance->yFirstPoint .",
- x_last_point = ". $distance->xLastPoint .", y_last_point = ". $distance->yLastPoint . " WHERE id = ". $fk_distance .";";
-
- $distanceExecQuery = SQLServerManager::executeQueryForTransaction( $distanceQuery, $transaction );
-
- $distanceId = $fk_distance;
- }
- }
-
- if ($area)
- {
- if (!$fk_area)
- {
- $areaQuery = "INSERT INTO [intimamedia_physician].[dbo].[t_area] (value, points) VALUES ".
- "(". $area->value .", CONVERT(varbinary(max), '". serialize($area->points) . "') );";
-
- $areaExecQuery = SQLServerManager::executeQueryForTransaction( $areaQuery, $transaction );
-
- $areaId = SQLServerManager::getLastId( "[intimamedia_physician].[dbo].[t_area]", $transaction );
- }
- else
- // UPDATE
- {
- $areaQuery = "UPDATE [intimamedia_physician].[dbo].[t_area] SET value = ". $area->value .",
- points = CONVERT(varbinary(max), '". serialize($area->points) . "') WHERE id = ". $fk_area .";";
-
- $areaExecQuery = SQLServerManager::executeQueryForTransaction( $areaQuery, $transaction );
-
- $areaId = $fk_area;
- }
- }
- if ($area2)
- {
- if (!$fk_area2)
- {
- $area2Query = "INSERT INTO [intimamedia_physician].[dbo].[t_area] (value, points) VALUES ".
- "(". $area2->value .", CONVERT(varbinary(max), '". serialize($area2->points) . "') );";
-
- $area2ExecQuery = SQLServerManager::executeQueryForTransaction( $area2Query, $transaction );
-
- $area2Id = SQLServerManager::getLastId( "[intimamedia_physician].[dbo].[t_area]", $transaction );
- }
- else
- // UPDATE
- {
- $area2Query = "UPDATE [intimamedia_physician].[dbo].[t_area] SET value = ". $area2->value .",
- points = CONVERT(varbinary(max), '". serialize($area2->points) . "') WHERE id = ". $fk_area2 .";";
-
- $area2ExecQuery = SQLServerManager::executeQueryForTransaction( $area2Query, $transaction );
-
- $area2Id = $fk_area2;
- }
- }
- if ($imtf)
- {
- if (!$fk_imtf)
- {
- $imtfQuery = "INSERT INTO [intimamedia_physician].[dbo].[t_imt] (max, mean, standard_deviation, iq, distance, number_of_point, imt, intima, adventitia) VALUES ".
- "(". number_format($imtf->max, 10) .", ". number_format($imtf->mean, 10) .", ". number_format($imtf->standardDeviation, 10) .", ". number_format($imtf->qualityIndex, 10) .", ".
- $imtf->distance .", ". $imtf->numberOfPoints .", 'F', CONVERT(varbinary(max), '". serialize($imtf->intima) . "'), CONVERT(varbinary(max), '" . serialize($imtf->adventitia) ."'))";
-
- $imtfExecQuery = SQLServerManager::executeQueryForTransaction( $imtfQuery, $transaction );
-
- $imtfId = SQLServerManager::getLastId( "[intimamedia_physician].[dbo].[t_imt]", $transaction );
- }
- else
- // UPDATE
- {
- $imtfQuery = "UPDATE [intimamedia_physician].[dbo].[t_imt] SET max = ". number_format($imtf->max, 10) .", mean = ". number_format($imtf->mean, 10) .",
- standard_deviation = ". number_format($imtf->standardDeviation, 10) .", iq = ". number_format($imtf->qualityIndex, 10) .",
- distance = ". $imtf->distance .", number_of_point = ". $imtf->numberOfPoints .", imt = 'F',
- intima = CONVERT(varbinary(max), '". serialize($imtf->intima) ."'), adventitia = CONVERT(varbinary(max), '". serialize($imtf->adventitia) ."')
- WHERE id = ". $fk_imtf .";";
-
-
- $imtfExecQuery = SQLServerManager::executeQueryForTransaction( $imtfQuery, $transaction );
-
- $imtfId = $fk_imtf;
- }
- }
-
- if ($imtn)
- {
- if (!$fk_imtn)
- {
- $imtnQuery = "INSERT INTO [intimamedia_physician].[dbo].[t_imt] (max, mean, standard_deviation, iq, distance, number_of_point, imt, intima, adventitia) VALUES ".
- "(". number_format($imtn->max, 10) .", ". number_format($imtn->mean, 10) .", ". number_format($imtn->standardDeviation, 10) .", ". number_format($imtn->qualityIndex, 10) .", ".
- $imtn->distance .", ". $imtn->numberOfPoints .", 'N', CONVERT(varbinary(max), '". serialize($imtn->intima) . "'), CONVERT(varbinary(max), '" . serialize($imtn->adventitia) ."'))";
-
- $imtnExecQuery = SQLServerManager::executeQueryForTransaction( $imtnQuery, $transaction );
-
- $imtnId = SQLServerManager::getLastId( "[intimamedia_physician].[dbo].[t_imt]", $transaction );
- }
- else
- // UPDATE
- {
- $imtnQuery = "UPDATE [intimamedia_physician].[dbo].[t_imt] SET max = ". number_format($imtn->max, 10) .", mean = ". number_format($imtn->mean, 10) .",
- standard_deviation = ". number_format($imtn->standardDeviation, 10) .", iq = ". number_format($imtn->qualityIndex, 10) .",
- distance = ". $imtn->distance .", number_of_point = ". $imtn->numberOfPoints .", imt = 'N',
- intima = CONVERT(varbinary(max), '". serialize($imtn->intima) ."'), adventitia = CONVERT(varbinary(max), '". serialize($imtn->adventitia) ."')
- WHERE id = ". $fk_imtn .";";
-
-
- $imtnExecQuery = SQLServerManager::executeQueryForTransaction( $imtnQuery, $transaction );
-
- $imtnId = $fk_imtn;
- }
- }
-
-
- if ($operation == INSERT)
- {
- $measureQuery = "INSERT INTO [intimamedia_physician].[dbo].[tj_measure] (fk_image, fk_scale, fk_measure_unit, fk_distance, fk_area, fk_area2, fk_imtf, fk_imtn, fk_ultra_sound_scanner) VALUES ".
- "(". $imgId .", ". $scaleId .", 1, " . $distanceId . ", ". $areaId . ", ". $area2Id. ", ". $imtfId . ", ". $imtnId . ", " . $ultraSoundScannerId .");";
-
- $execMeasureQuery = SQLServerManager::executeQueryForTransaction( $measureQuery, $transaction );
- }
- else
- {
- $measureQuery = "UPDATE [intimamedia_physician].[dbo].[tj_measure] SET fk_imtf = ". $imtfId .", fk_imtn = ". $imtnId . ",
- fk_scale = ". $scaleId .", fk_distance = ". $distanceId ." , fk_area = ". $areaId.", fk_area2 = ". $area2Id .
- " WHERE id = ". $measureId .";";
-
- $execMeasureQuery = SQLServerManager::executeQueryForTransaction( $measureQuery, $transaction );
- }
-
- /* $ff=fopen("tmp.jd", "a+");
- fprintf($ff, "imtPersist, sql=%s\n", $measureQuery );
- fclose($ff);*/
-
- if( $execMeasureQuery )
- {
- SQLServerManager::commitTransaction( $transaction );
- }
- else
- {
- Throw new Exception("E021");
- }
- }
-
- public function saveMeasures( $list, $token )
- {
- $returnObjectVo = new ReturnObjectVo();
- $returnObjectVo->token = SecurityManager::verifyToken( $token );
-
- foreach( $list as $value )
- {
- $imgId = $value->id;
- $scale = $value->scale;
- $distance = $value->distance;
- $area = $value->area;
- $area2 = $value->area2;
- $nwImtResult = $value->nwImtResult;
- $fwImtResult = $value->fwImtResult;
- $ultraSoundScanner = $value->ultrasoundscanner;
-
- $query = "SELECT id FROM [intimamedia_physician].[dbo].[tj_measure] WHERE fk_image = ". $imgId;
-
- $results = SQLServerManager::queryOnDatabase( $query );
-
- $resultArray = array();
-
- $measureId = 0;
-
- foreach( $results as $val )
- {
- $measureId = $val->id;
- }
-
- $operation = INSERT;
- if ($measureId)
- {
- // update
- $operation = UPDATE;
- }
-
- MeasureService::persistMeasure($measureId, $imgId, $operation, $scale, $distance, $area, $area2, $fwImtResult, $nwImtResult, $ultraSoundScanner);
- }
-
- return $returnObjectVo;
- }
-
- public function getMeasures($imgIdList)
- {
- $query = "SELECT * "
- ."FROM [intimamedia_physician].[dbo].[tj_measure] m "
- ."WHERE fk_image in (". implode(',', $imgIdList) .")";
- /* $ff=fopen("d:/tmp.jd", "a+");
- fprintf($ff, "getMeasures = %s\n", $query);
- fclose($ff);*/
-
- $results = SQLServerManager::queryOnDatabase( $query );
- if( count($results) == 0 )
- {
- Throw new Exception("E023");
- }
- $resultArray = array();
- foreach( $results as $value )
- {
- $measuresVo = new MeasuresVo();
-
- $measuresVo->id = $value->id;
- $measuresVo->imageId = $value->fk_image;
- $measuresVo->measureUnit = $value->fk_measure_unit;
-
- if ($value->fk_scale)
- {
- $scaleQuery = "SELECT * FROM [intimamedia_physician].[dbo].[t_scale]"
- ." WHERE id = '" . $value->fk_scale . "'";
-
- $scaleExecQuery = SQLServerManager::queryOnDatabase( $scaleQuery );
-
- $scaleVo = new ScaleVo();
- foreach( $scaleExecQuery as $scaleResult )
- {
- $scaleVo->id = $scaleResult->id;
- $scaleVo->value = $scaleResult->value;
- $scaleVo->length = $scaleResult->length;
- $scaleVo->xFirstPoint = $scaleResult->x_first_point;
- $scaleVo->yFirstPoint = $scaleResult->y_first_point;
- $scaleVo->xLastPoint = $scaleResult->x_last_point;
- $scaleVo->yLastPoint = $scaleResult->y_last_point;
- }
-
- $measuresVo->scale = $scaleVo;
- }
-
- if ($value->fk_distance)
- {
- $distanceQuery = "SELECT * FROM [intimamedia_physician].[dbo].[t_distance]"
- ." WHERE id = '" . $value->fk_distance . "'";
-
- $distanceExecQuery = SQLServerManager::queryOnDatabase( $distanceQuery );
-
- $distanceVo = new DistanceVo();
- foreach( $distanceExecQuery as $distanceResult )
- {
- $distanceVo->id = $distanceResult->id;
- $distanceVo->value = $distanceResult->value;
- $distanceVo->type = $distanceResult->type;
- $distanceVo->xFirstPoint = $distanceResult->x_first_point;
- $distanceVo->yFirstPoint = $distanceResult->y_first_point;
- $distanceVo->xLastPoint = $distanceResult->x_last_point;
- $distanceVo->yLastPoint = $distanceResult->y_last_point;
- }
-
- $measuresVo->distance = $distanceVo;
- }
-
- if ($value->fk_area)
- {
- $areaQuery = "SELECT * FROM [intimamedia_physician].[dbo].[t_area]"
- ." WHERE id = '" . $value->fk_area . "'";
-
- $areaExecQuery = SQLServerManager::queryOnDatabase( $areaQuery );
-
- $areaVo = new AreaVo();
- foreach( $areaExecQuery as $areaResult )
- {
- $areaVo->id = $areaResult->id;
- $areaVo->value = $areaResult->value;
- $areaVo->points = unserialize($areaResult->points);
- }
-
- $measuresVo->area = $areaVo;
- }
- if ($value->fk_area2)
- {
- $area2Query = "SELECT * FROM [intimamedia_physician].[dbo].[t_area]"
- ." WHERE id = '" . $value->fk_area2 . "'";
-
- $area2ExecQuery = SQLServerManager::queryOnDatabase( $area2Query );
-
- $area2Vo = new AreaVo();
- foreach( $area2ExecQuery as $areaResult )
- {
- $area2Vo->id = $areaResult->id;
- $area2Vo->value = $areaResult->value;
- $area2Vo->points = unserialize($areaResult->points);
- }
-
- $measuresVo->area2 = $area2Vo;
- }
-
- if ($value->fk_imtf)
- {
- /* $imtfQuery = "SELECT id, max, mean, standard_deviation, distance, number_of_point, imt, CONVERT(varchar, intima) as intima, CONVERT(varchar, adventitia) as adventitia "
- ."FROM [intimamedia_physician].[dbo].[t_imt] "
- ."WHERE id = '" . $value->fk_imtf . "'";*/
-
- $imtfQuery = "SELECT *, CONVERT(varchar(max), intima) as intimaString, CONVERT(varchar(max), adventitia) as adventitiaString "
- ."FROM [intimamedia_physician].[dbo].[t_imt] "
- ."WHERE id = '" . $value->fk_imtf . "'";
-
- /* $ff=fopen("d:/tmp.jd", "a+");
- fprintf($ff, "getMeasures, imtfQuery = %s\n", $imtfQuery);
- fclose($ff);*/
-
- $imtfResults = SQLServerManager::queryOnDatabase( $imtfQuery );
-
- foreach( $imtfResults as $imtfValue )
- {
- $imtfResultVo = new ImtResultVo();
- $imtfResultVo->id = $imtfValue->id;
- $imtfResultVo->name = "F";
- $imtfResultVo->max = $imtfValue->max;
- $imtfResultVo->mean = $imtfValue->mean;
- $imtfResultVo->standardDeviation = $imtfValue->standard_deviation;
- $imtfResultVo->qualityIndex = $imtfValue->iq;
- $imtfResultVo->distance = $imtfValue->distance;
- $imtfResultVo->numberOfPoints = $imtfValue->number_of_point;
- $imtfResultVo->iStartx = $imtfValue->i_startx;
- $imtfResultVo->iStarty = $imtfValue->i_starty;
- $imtfResultVo->iEndx = $imtfValue->i_endx;
- $imtfResultVo->iEndy = $imtfValue->i_endy;
- $imtfResultVo->aStartx = $imtfValue->a_startx;
- $imtfResultVo->aStarty = $imtfValue->a_starty;
- $imtfResultVo->aEndx = $imtfValue->a_endx;
- $imtfResultVo->aEndy = $imtfValue->a_endy;
- $imtfResultVo->intima = unserialize($imtfValue->intimaString);
- $imtfResultVo->adventitia = unserialize($imtfValue->adventitiaString);
-
- /* $ff=fopen("d:/tmp.jd", "a+");
- fprintf($ff, "getMeasures, intima = %s\n", $imtfValue->intimaString);
- fclose($ff);*/
- }
-
- $measuresVo->fwImt = $imtfResultVo;
- }
-
- if ($value->fk_imtn)
- {
- $imtnQuery = "SELECT *, CONVERT(varchar(max), intima) as intimaString, CONVERT(varchar(max), adventitia) as adventitiaString "
- ."FROM [intimamedia_physician].[dbo].[t_imt] "
- ."WHERE id = '" . $value->fk_imtn . "'";
-
- /* $ff=fopen("d:/tmp.jd", "a+");
- fprintf($ff, "getMeasures, imtnQuery = %s\n", $imtnQuery);
- fclose($ff);*/
-
- $imtnResults = SQLServerManager::queryOnDatabase( $imtnQuery );
-
- foreach( $imtnResults as $imtnValue )
- {
- $imtnResultVo = new ImtResultVo();
- $imtnResultVo->id = $imtnValue->id;
- $imtnResultVo->name = "N";
- $imtnResultVo->max = $imtnValue->max;
- $imtnResultVo->mean = $imtnValue->mean;
- $imtnResultVo->standardDeviation = $imtnValue->standard_deviation;
- $imtnResultVo->qualityIndex = $imtnValue->iq;
- $imtnResultVo->distance = $imtnValue->distance;
- $imtnResultVo->numberOfPoints = $imtnValue->number_of_point;
- $imtnResultVo->iStartx = $imtnValue->i_startx;
- $imtnResultVo->iStarty = $imtnValue->i_starty;
- $imtnResultVo->iEndx = $imtnValue->i_endx;
- $imtnResultVo->iEndy = $imtnValue->i_endy;
- $imtnResultVo->aStartx = $imtnValue->a_startx;
- $imtnResultVo->aStarty = $imtnValue->a_starty;
- $imtnResultVo->aEndx = $imtnValue->a_endx;
- $imtnResultVo->aEndy = $imtnValue->a_endy;
- $imtnResultVo->intima = unserialize($imtnValue->intimaString);
- $imtnResultVo->adventitia = unserialize($imtnValue->adventitiaString);
- }
-
- $measuresVo->nwImt = $imtnResultVo;
- }
-
- array_push( $resultArray, $measuresVo );
- }
-
- return $resultArray;
- }
-
- public function getUltraSoundScanner($login)
- {
- $queryUSS = "SELECT uss.* FROM [intimamedia_physician].[dbo].[t_ultra_sound_scanner] as uss "
- ."INNER JOIN [evolucare].[dbo].[tj_facilities] as f ON f.fk_ultra_sound_scanner = uss.id "
- ."INNER JOIN [evolucare].[dbo].[t_organization] as o ON o.id = f.fk_organization "
- ."INNER JOIN [evolucare].[dbo].[t_person] as p ON p.fk_organization = o.id "
- ."INNER JOIN [evolucare].[dbo].[tj_user] as u ON u.fk_person = p.id "
- ."AND u.login = '". $login ."'";
-
- $resultsUSS = SQLServerManager::queryOnDatabase( $queryUSS );
- $resultArray = array();
- foreach( $resultsUSS as $value )
- {
- $ultraSoundScannerVo = new UltraSoundScannerVo();
- $ultraSoundScannerVo->name = $value->id;
- $ultraSoundScannerVo->name = trim( $value->name );
- $ultraSoundScannerVo->brand = trim( $value->brand );
- $ultraSoundScannerVo->type = trim( $value->type );
- $ultraSoundScannerVo->age = date( "Y-m-d", $value->age/1000 );
- $ultraSoundScannerVo->probes = array();
-
- $queryP = "SELECT pr.* FROM [intimamedia_physician].[dbo].[t_probe] as pr "
- ."INNER JOIN [intimamedia_physician].[dbo].[tj_list_probe] as l ON pr.id = l.fk_probe "
- ."INNER JOIN [intimamedia_physician].[dbo].[t_ultra_sound_scanner] as uss ON l.fk_ultra_sound_scanner = uss.id "
- ."INNER JOIN [evolucare].[dbo].[tj_facilities] as f ON f.fk_ultra_sound_scanner = uss.id "
- ."INNER JOIN [evolucare].[dbo].[t_organization] as o ON o.id = f.fk_organization "
- ."INNER JOIN [evolucare].[dbo].[t_person] as p ON p.fk_organization = o.id "
- ."INNER JOIN [evolucare].[dbo].[tj_user] as u ON u.fk_person = p.id "
- ."AND u.login = '". $login ."' AND uss.id = ". $value->id ."";
- $resultsP = SQLServerManager::queryOnDatabase( $queryP );
- foreach( $resultsP as $probe )
- {
-
- $probeVo = new probeVo();
-
- $probeVo->name = $probe->id;
- $probeVo->frequency = $probe->frequency;
- array_push( $ultraSoundScannerVo->probes , $probeVo );
- }
-
- array_push( $resultArray, $ultraSoundScannerVo );
- }
- return $resultArray;
- }
-
- // Calcul la valeur de CTPA
- public function getCTPA($idRdv)
- {
- $returnObjectVo = new ReturnObjectVo();
- $result = 0.0;
- /*
- $ff=fopen("tmp4.txt", "a+");
- fprintf($ff, "\nEntrée, IDRDV = \n".$idRdv);
- fclose($ff);
- */
- $queryAREA = "SELECT area.* FROM [intimamedia_physician].[dbo].[t_area] as area "
- ."INNER JOIN [intimamedia_physician].[dbo].[tj_measure] as meas ON area.id = meas.fk_area "
- ."INNER JOIN [intimamedia_physician].[dbo].[t_image] as img ON meas.fk_image = img.id "
- ."INNER JOIN [intimamedia_physician].[dbo].[tj_appointment] as app ON img.fk_appointment = app.id "
- ."AND app.id = ". $idRdv ."";
- /*
- $ff=fopen("tmp3.txt", "a+");
- fprintf($ff, "\nQuery : \n".$queryAREA);
- fclose($ff);
- */
- $resultsAREA = SQLServerManager::queryOnDatabase( $queryAREA );
- foreach( $resultsAREA as $surface )
- {
- $result += $surface->value;
- }
- $queryAREA2 = "SELECT area.* FROM [intimamedia_physician].[dbo].[t_area] as area "
- ."INNER JOIN [intimamedia_physician].[dbo].[tj_measure] as meas ON area.id = meas.fk_area2 "
- ."INNER JOIN [intimamedia_physician].[dbo].[t_image] as img ON meas.fk_image = img.id "
- ."INNER JOIN [intimamedia_physician].[dbo].[tj_appointment] as app ON img.fk_appointment = app.id "
- ."AND app.id = ". $idRdv ."";
- $resultsAREA2 = SQLServerManager::queryOnDatabase( $queryAREA2 );
- foreach( $resultsAREA2 as $surface )
- {
- $result += $surface->value;
- }
- $returnObjectVo->value = $result;
- return $returnObjectVo;
- }
- public function majCptMesures($login, $comptMesures)
- {
- $query = "UPDATE [evolucare].[dbo].[tj_user] set nbMesures=". $comptMesures ."".
- " WHERE login = '".$login."'";
-
- SQLServerManager::queryOnDatabase( $query );
-
- $returnObjectVo = new ReturnObjectVo();
- return $returnObjectVo;
- }
- }
- ?>
|