Skip to content

Commit

Permalink
add functions to get/set rxcui, changed method variable orders to all…
Browse files Browse the repository at this point in the history
…ow for null rxcui when rxcui is a set object parameter.
  • Loading branch information
redcap3000 committed Aug 5, 2011
1 parent 272bf63 commit e96323d
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions rxNormApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ public function setOutputType($type){
if($type != $this->output_type)
$this->output_type = ($type != 'xml'?'json':'xml');
}
public function findRxcuiByString( $name, $searchString =NULL,$searchType=NULL,$source_list=NULL, $allSourcesFlag=NULL){
public function setRxcui($rxcui){
$this->rxcui = $rxcui;
}

public function getRxcui($rxcui=NULL){
if($rxcui != NULL) return $rxcui;
elseif($this->rxcui) return $this->rxcui;
}
public function findRxcuiByString( $name, $searchString =NULL,$searchType=NULL,$source_list=NULL, $allSourcesFlag=NULL) {
$data['name'] = $name;
if($allSourcesFlag =! NULL ){
$data['allsrc'] = $allSourcesFlag;
Expand All @@ -45,23 +53,28 @@ public function getSpellingSuggestions( $searchString ){
return self::_request("/spellingsuggestions?name=$searchString",'GET');
}

public function getRxConceptProperties( $rxcui ){
public function getRxConceptProperties( $rxcui = NULL ){
$rxcui = self::getRxcui($rxcui);
return self::_request('/rxcui/'.$rxcui.'/properties','GET');
}
public function getRelatedByRelationship( $rxcui, $relationship_list ){
public function getRelatedByRelationship( $relationship_list , $rxcui = NULL ){
$rxcui = self::getRxcui($rxcui);
return self::_request("/rxcui/$rxcui/related?rela=$relationship_list",'GET');
}
public function getRelatedByType( $rxcui, $type_list ){
public function getRelatedByType($type_list, $rxcui = NULL ){
$rxcui = self::getRxcui($rxcui);
return self::_request("/rxcui/$rxcui/related?tty=$type_list",'GET');
}
public function getAllRelatedInfo( $rxcui ){
public function getAllRelatedInfo( $rxcui = NULL ){
$rxcui = self::getRxcui($rxcui);
return self::_request("/rxcui/$rxcui/allrelated",'GET');
}
public function getDrugs( $name ){
return self::_request("/drugs?name=$name",'GET');
}

public function getNDCs( $rxcui ){
public function getNDCs( $rxcui = NULL){
$rxcui = self::getRxcui($rxcui);
return self::_request("/rxcui/$rxcui/ndcs",'GET');
}

Expand Down

0 comments on commit e96323d

Please sign in to comment.