SO stands for "special order." Usually they are designated as S.O. #1 (or some other number). The special order relating to your ancestor was apparently issued on April 22, 1864. That does not mean he was detached on that date--he could have been detached at any time while that special order was still in effect. It's possible the special order of April 22, 1864 is reproduced in the Official Records. There were many bureaus and agencies developed by the Confederacy in the Trans-Mississippi so your ancestor was detached for service at one of those. As a result of his wound he may not have been able to continue in active service and therefore was detached.